diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-5FBA9BB1-94A2-470C-9932-C4255E3774C0.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-5FBA9BB1-94A2-470C-9932-C4255E3774C0.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,97 @@ + + + + + +Shared +Memory between ThreadsThis document describes the shared memory between threads and how +to avoid race conditions. +

Shared memory is a method of InterProcess Communication (IPC) where a single +chunk of memory is shared between two or more processes. It is used to communicate +between threads within a process or two unrelated processes, allowing both +to share a given region of memory efficiently. In an SMP system, multiple +cores are running threads at the same time and not just virtually as in unicore. +Extra caution is needed to handle memory that shared between multiple threads.

+

A thread is the unit of execution within a process. Every time a process +is initialized, a primary thread is created. For many applications the primary +thread is the only one that the application requires, however, processes can +create additional threads. In an SMP system, multiple threads can be executing +the same (shared) functions simultaneously. Therefore functions need to deal +with this situation in order to maintain consistency of the system.

+

Following are the key concepts to synchronize threads:

+ + + +

Shared memory between threads is provided by the following APIs: + + + +

API name

+

Description

+
+ + + +

TFindThread

+

Searches for threads by pattern matching against the names of thread +objects.

+
+ +

RThread

+

A handle to a thread.

+
+ +

RMutex

+

A handle to a mutex.

+
+ +

TFindMutex

+

Finds all global mutexes whose full names match a specified pattern.

+
+ +

RSemaphore

+

A handle to a semaphore.

+
+ +

TFindSemaphore

+

Finds all global semaphores whose full names match a specified pattern.

+
+ + +

+
+Threads And +Processes Overview +Mutexes Overview + +Semaphores +Overview +
\ No newline at end of file