CSmpExample Class Reference

List of all members.

Public Member Functions

virtual ~CSmpExample ()
void CreateDatabaseL (const TDesC &aDbName)
void PrintMessage ()
void StartThreads ()

Static Public Member Functions

static CSmpExampleNewL ()
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 ()

Detailed Description

This class creates three threads to demonstrate multithreading in a unicore and a SMP environment.

Definition at line 28 of file SmpExample.h.


Constructor & Destructor Documentation

CSmpExample::~CSmpExample (  )  [virtual]

Destructor

Definition at line 22 of file SmpExample.cpp.


Member Function Documentation

CSmpExample * CSmpExample::NewL (  )  [static]

NewL()

Definition at line 33 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 351 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 220 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 324 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 297 of file SmpExample.cpp.

void CSmpExample::ReadBothDatabasesL (  )  [static]

Creates a console, reads the databases and prints output to the console.

Definition at line 199 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 131 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 245 of file SmpExample.cpp.

void CSmpExample::PrintMessage (  ) 

Prints welcome message and purpose of the example.

Definition at line 106 of file SmpExample.cpp.

void CSmpExample::StartThreads (  ) 

Starts the three threads

Definition at line 75 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 45 of file SmpExample.cpp.


Generated by  doxygen 1.6.2