Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Threads And Processes Overview


Purpose

Provides access to processes, threads, and thread-local storage.

Processes are usually only manipulated directly by system programs. Threads can be directly manipulated by multi-threaded programs. Note however that the active objects framework provided by the Asynchronous Services API is usually preferred to multi-threading in EPOC programming.

[Top]


Description

The API has three key concepts: process, thread, and thread-local storage.


Process

A program running in EPOC is a process, which can contains one or more conceptually concurrent threads of execution. Each user process has its own private address space. A process can create another process.

Processes are Kernel objects and so are accessed by user programs through handles.

The process handle interface is provided by RProcess.

TFindProcess is used for finding another process.


Thread

A thread is the unit of execution within a process. The scheduling of threads is pre-emptive, i.e. a currently executing thread may be suspended at any time to allow another thread to run.

Note the following properties of threads:

Threads are Kernel objects and so are accessed by user programs through handles.

The thread handle interface is provided by RThread.

TFindThread is used for finding another thread.

The System Static Functions API User class provides a number of functions that operate on the current thread.


Thread-local storage

Thread-local storage in EPOC supports one machine word of static data per DLL per thread. The scope of the word is the thread and is only accessible to DLL code. DLL code running on behalf of one thread does not see the same word when running on behalf of another thread.

The thread-local storage interface is provided by Dll.

[Top]


See also

Asynchronous Services Overview

System Static Functions Overview