|
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 id="GUID-3829BD20-3DCB-5489-8FC4-07F954E391BF" xml:lang="en"><title>Local |
|
13 and global handles</title><shortdesc>This document explains the distinction between local and global |
|
14 handles.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <p>This is the issue of Kernel side object visibility.</p> |
|
16 <p>Handles are said to be local or global.</p> |
|
17 <p>A handle is <i>local</i>, if the Kernel object which that handle represents |
|
18 is only visible to the thread that created it; no other thread can open a |
|
19 handle to the same Kernel object.</p> |
|
20 <p>Typically, code constructs the appropriate <codeph>RHandleBase</codeph> derived |
|
21 object, e.g. an <codeph>RMutex</codeph>, and calls its <codeph>Create()</codeph>, <codeph>CreateLocal()</codeph> or |
|
22 equivalent function to create the corresponding Kernel object.</p> |
|
23 <p>A handle is <i>global</i>, if the Kernel object which that handle represents |
|
24 is visible to all threads across all processes; any thread in any process |
|
25 can open a handle to that same Kernel object. Typically, such a Kernel object |
|
26 is intended for sharing.</p> |
|
27 <p>For a global handle. the corresponding Kernel object is assigned a name. |
|
28 The name gives that Kernel object an identity and is the key property which |
|
29 allows other threads to open a handle onto that same object. It is usual to |
|
30 use a <codeph>TFindHandleBase</codeph> <i>derived</i> class to locate a global |
|
31 Kernel object. The following diagram shows the general idea.</p> |
|
32 <fig id="GUID-01C60CFA-8CA7-51CC-904E-158EC02959DE"> |
|
33 <image href="GUID-5398C2DC-9AFA-5517-BCBF-5964970B9656_d0e234441_href.png" placement="inline"/> |
|
34 </fig> |
|
35 <p>See also:</p> |
|
36 <ul> |
|
37 <li id="GUID-56D39619-C90C-51DF-9475-3B75FB189258"><p><xref href="GUID-FC639517-F138-5E84-B57A-6347F5A47B88.dita">Names |
|
38 and fullnames</xref> in reference counting objects.</p> </li> |
|
39 </ul> |
|
40 </conbody></concept> |