Threading Model

Describes the impacts of thread execution in SMP environment.

In single core system, the active threads are executed in a time-sliced fashion and appear to run in parallel. In a multi-core environment, multiple threads can be executed in parallel and can also use time-sliced thread execution.

Single-threaded code

The applications designed with single threads will not have any performance benefit by using multiple cores. The contention for CPU usage may be reduced on multi-core hardware. The single threaded code should run normally on multi-core hardware. Some code is more efficient having single threads and some code performs better with multiple threads.
Note: It is not recommended to modify a single-threaded application into multi-threaded code until the existing code runs safely on multiple-core hardware. But new applications can be designed to be multi-threaded to take advantage of the SMP hardware.

Servers

Most servers on Symbian platform are single threaded and are unlikely to need any modification to migrate to a multi-core hardware. Some servers may need to service multiple clients concurrently. One of the solutions to take advantage of SMP hardware is to modify the servers to have multiple threads to service the clients concurrently. The performance can also be improved by implementing caching in the server.

Active scheduler

Active schedulers are designed to be single threaded and the active objects never run concurrently because there is no need for a lock in the data shared between active objects. The active scheduler will only execute one active object at a time. The existing code should run safely on multi-core hardware. If the active objects need to use multiple cores then the code should be modified to be multi-threaded and use locks when there is shared data between the threads.

User-side code

The user-side applications that use Symbian platform Inter Process Communication (IPC) functions like RThread::Rendezvous(), User::RequestComplete(), RSession::SendReceive() or Publish-Subscribe should run safely on multi-core hardware. If the user-side code uses some proprietary IPC mechanism to communicate with other process, that code may need to be modified to use Symbian IPC functions.

The following table compares the advantages of single-threaded and multi-threaded applications on an SMP hardware:
Single-threaded applications Multi-threaded applications
Low CPU usage for schedulers Parallel execution provides faster execution
Low memory overhead Added control on power consumption
Low cache overhead Servers that have to service multiple clients can run on different CPUs
Related concepts
SMP Overview