About S60 Platform: Multiple Threads Example v1.1

--------------------

The Thread Example is an example program that demonstrates thread usage and

synchronization. The example is based on the document Symbian OS: Threads Programming.

 

Prerequisites

------------

- Active Objects

- Multitasking

- Symbian OS key concepts

 

Running the Thread Example

----------------------

Open the options menu. Select "Start threads."

Now you should see three animations running.

Open the options menu again and start killing threads.

After killing a thread, the thread should reactivate in a

few seconds, that is, the animation should reappear.

 

All threads are counting while they are running.

Thread2 and thread3 are synchronized and they increment the same

TInt counter. Thread1 increments a separate counter by itself,

thus no synchronization is required. Threads print the value

of the counter on the screen when they have been killed.

The user can be sure that the thread is running if the value

of the counter is bigger than zero. The counter of Thread1 is reset

when thread1 is killed. The counter of Thread2 & thread3 is reset

when thread2 or thread3 has been killed.

 

Installation instructions

-----------------------

-----------------------

 

DEVICE

------------------

S60 2nd Edition SDKs:

    Go to /ThreadExample/group

    bldmake bldfiles

    abld build armi urel

    Go to /ThreadExample/sis

    makesis Series60_v2x_thread.pkg

    Install the .sis file to your device

 

S60 3rd Edition SDK:

    Go to /ThreadExample/group

    bldmake bldfiles

    abld build [armv5 | gcce] urel

    go to /ThreadExample/sis

    makesis [Series60_v30_thread_armv5.pkg | Series60_v30_thread_gcce.pkg]

   

    Sign the SIS package with the signsis utility

    - See the SDK Help for information about self-signed .sis packages, or

    www.symbiansigned.com for information about Developer Certificates.

   

    install the .sis file to your device

 

 

EMULATOR

------------------

WINS:

    Go to /ThreadExample/group

    bldmake bldfiles

    abld build wins udeb

    Start the emulator

   

    Note! Visual Studio .NET IDE does not compile the .mbm file. Use the abld

    build from the command line.

 

WINSCW:

    Go to /ThreadExample/group

    bldmake bldfiles

    abld build winscw udeb

    Start the emulator

 

    It is possible to create a project for CodeWarrior IDE by running the following command:

    abld makefile cw_ide

   

    In addition, it is possible to create a project from CodeWarrior IDE:

    Open CodeWarrior IDE

    Select File -> Import from .mmp file

    Browse to /ThreadExample/group folder and select [Thread_s60_3rd_ed.mmp | Thread_s60_2nd_ed.mmp]

    Select Project -> Make

    Select Project -> Run

   

    After successful build, the application can be found and started from

    Applications > Installed > Thread

 

 

Known Issues

-------------

    NOTE concerning 3rd Edition: When creating a project from the .mmp file, the .mbm building tool is not invoked.

    Use the abld build from command line once to get the necessary .mbm file.

 

 

Notes on porting to S60 3rd Edition

-----------------------------------

A new .mmp file (Thread_s60_3rd_ed.mmp)  + Thread_reg.rss + .pkg files for

3rd Edition (both for armv5 and gcce) created. [The .mmp and .pkg files for 2nd Edition also renamed for clarity.]

 

icons_aif.mk and thread_loc.rss created.

EKA2 definition (for selecting the right .mmp) into the bld.inf file added.

 

Changes to the .mmp file:

                      Target changed from .app to .exe.

                      Resource definitions changed.               

                      VendorID 0x0 added.

                      ReadUserData capability added.

 

Changes to the source code:

                      thread.cpp:

                                            E32Main function added (application started from eikstart.h) + conditional compiling

                                            macros to support both S60 3rd Edition and previous platforms.

 

                      richtexteditorrte.cpp:

                                            Method SetContainerWindowL(aView) (derived from CCoeControl) added into the 2nd phase constructor.

                     

                      threadappui:

                                            BaseConstructL(EAknEnableSkin) added into the 2nd phase constructor to ensure skin support.

 

                      desctructors in various source files:

                                            Nulling/zeroing of deleted objects removed.

 

Compatibility

-------------

(S60 1st Edition)

S60 2nd Edition

S60 3rd Edition

 

Tested with Nokia 6600, Nokia 6630, and Nokia E60.

 

Version history

---------------

1.0                 Original example

1.1                 Support for S60 3rd Edition added

 

 

Evaluate This Resource

--------------------------------

Please spare a moment to help us improve documentation quality and recognize the

resources you find most valuable, by rating this resource.