Symbian3/SDK/Source/GUID-E865E677-1219-500C-89CF-0A2835B91834.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept xml:lang="en" id="GUID-E865E677-1219-500C-89CF-0A2835B91834"><title>Semaphores Overview</title><prolog><metadata><keywords/></metadata></prolog><conbody><section><title>Purpose</title> <p>Synchronises co-operation between threads. </p> </section> <section><title>Architectural relationships</title> <p>Every thread in Symbian OS automatically has a semaphore called a <i>thread request semaphore</i>. It is the underlying mechanism by which a thread is put in a waiting state until an asynchronous request completes.</p> <p>The thread request semaphore is accessed through the System Static Functions API.</p> </section> <section><title>Description</title> <p>A semaphore restricts the number of simultaneous users of a shared resource up to a maximum number. Threads can request access to the resource (decrementing the semaphore), and can signal that they have finished using the resource (incrementing the semaphore).</p> <p>A thread that requests access to a busy resource is put in a waiting state. The semaphore maintains a FIFO queue of such waiting threads. When another thread increments the semaphore, the first thread in this queue is resumed.</p> <p>Semaphores are Kernel objects and, as such, are managed by the Kernel, and accessed by user programs through handles. </p> <p>The semaphore handle is provided by <xref href="GUID-AED27A76-3645-3A04-B80D-10473D9C5A27.dita"><apiname>RSemaphore</apiname></xref>.</p> <p><xref href="GUID-F3ACDC41-31EE-3C32-BE2C-D696B84931CD.dita"><apiname>TFindSemaphore</apiname></xref> is used for finding a semaphore created by another process.</p> </section> <section><title>See also</title> <p><xref href="GUID-1294F540-FDA7-5050-BAFB-3C9888491B98.dita">Asynchronous Services Overview</xref> </p> <p><xref href="GUID-FF8F5D97-7D37-5F6B-84A3-C064E2FD53E0.dita">System Static Functions Overview</xref> </p> </section> </conbody></concept>