Public Member Functions | |
virtual | ~CSmpExample () |
void | CreateDatabaseL (const TDesC &aDbName) |
void | PrintMessage () |
void | StartThreads () |
Static Public Member Functions | |
static CSmpExample * | NewL () |
static TInt | ReadThreadFuncL (TAny *aPtr) |
static TInt | WriteThread1FuncL (TAny *aPtr) |
static TInt | WriteThread2FuncL (TAny *aPtr) |
static void | ReadBothDatabasesL () |
static void | ReadDatabaseL (const TDesC &aDbName, CConsoleBase &console) |
static void | WriteDbFuncL (const TDesC &aDbName, TInt aNum) |
Protected Member Functions | |
void | ConstructL () |
This class creates three threads to demonstrate multithreading in a unicore and a SMP environment.
Definition at line 42 of file SmpExample.h.
CSmpExample::~CSmpExample | ( | ) | [virtual] |
Destructor
Definition at line 38 of file SmpExample.cpp.
CSmpExample * CSmpExample::NewL | ( | ) | [static] |
Definition at line 49 of file SmpExample.cpp.
void CSmpExample::CreateDatabaseL | ( | const TDesC & | aDbName | ) |
Creates a named database with the name specified in the parameter, creates a table and adds columns to it.
Definition at line 367 of file SmpExample.cpp.
TInt CSmpExample::ReadThreadFuncL | ( | TAny * | aPtr | ) | [static] |
This function is called when iReadThread is resumed. It creates a cleanup stack and calls ReadBothDatabasesL() to read both the databases.
Definition at line 236 of file SmpExample.cpp.
TInt CSmpExample::WriteThread1FuncL | ( | TAny * | aPtr | ) | [static] |
This function is called when iWriteThread is resumed. It creates a cleanup stack and calls WriteDbFuncL() to write integers to KDatabase1.
Definition at line 340 of file SmpExample.cpp.
TInt CSmpExample::WriteThread2FuncL | ( | TAny * | aPtr | ) | [static] |
This function is called when iWriteThread is resumed. It creates a cleanup stack and calls WriteDbFuncL() to write integers to KDatabase2.
Definition at line 313 of file SmpExample.cpp.
void CSmpExample::ReadBothDatabasesL | ( | ) | [static] |
Creates a console, reads the databases and prints output to the console.
Definition at line 215 of file SmpExample.cpp.
void CSmpExample::ReadDatabaseL | ( | const TDesC & | aDbName, | |
CConsoleBase & | console | |||
) | [static] |
Opens the database named in the first parameter, reads it and prints the output to the console.
Definition at line 147 of file SmpExample.cpp.
void CSmpExample::WriteDbFuncL | ( | const TDesC & | aDbName, | |
TInt | aNum | |||
) | [static] |
Opens the database specified in the first parameter aDbName and writes consecutive integers to it starting from the number specified in the second parameter aNum.
Definition at line 261 of file SmpExample.cpp.
void CSmpExample::PrintMessage | ( | ) |
Prints welcome message and purpose of the example.
Definition at line 122 of file SmpExample.cpp.
void CSmpExample::StartThreads | ( | ) |
Starts the three threads
Definition at line 91 of file SmpExample.cpp.
void CSmpExample::ConstructL | ( | ) | [protected] |
Creates three threads; one for reading from the databases and the other two for writing to the databases.
Definition at line 61 of file SmpExample.cpp.