<?xml version="1.0" encoding="utf-8"?><!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --><!-- This component and the accompanying materials are made available under the terms of the License "Eclipse Public License v1.0" which accompanies this distribution, and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --><!-- Initial Contributors: Nokia Corporation - initial contribution.Contributors: --><!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"><concept id="GUID-3829BD20-3DCB-5489-8FC4-07F954E391BF" xml:lang="en"><title>Localand global handles</title><shortdesc>This document explains the distinction between local and globalhandles.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody><p>This is the issue of Kernel side object visibility.</p><p>Handles are said to be local or global.</p><p>A handle is <i>local</i>, if the Kernel object which that handle representsis only visible to the thread that created it; no other thread can open ahandle to the same Kernel object.</p><p>Typically, code constructs the appropriate <codeph>RHandleBase</codeph> derivedobject, e.g. an <codeph>RMutex</codeph>, and calls its <codeph>Create()</codeph>, <codeph>CreateLocal()</codeph> orequivalent function to create the corresponding Kernel object.</p><p>A handle is <i>global</i>, if the Kernel object which that handle representsis visible to all threads across all processes; any thread in any processcan open a handle to that same Kernel object. Typically, such a Kernel objectis intended for sharing.</p><p>For a global handle. the corresponding Kernel object is assigned a name.The name gives that Kernel object an identity and is the key property whichallows other threads to open a handle onto that same object. It is usual touse a <codeph>TFindHandleBase</codeph> <i>derived</i> class to locate a globalKernel object. The following diagram shows the general idea.</p><fig id="GUID-01C60CFA-8CA7-51CC-904E-158EC02959DE"><image href="GUID-5398C2DC-9AFA-5517-BCBF-5964970B9656_d0e205824_href.png" placement="inline"/></fig><p>See also:</p><ul><li id="GUID-56D39619-C90C-51DF-9475-3B75FB189258"><p><xref href="GUID-FC639517-F138-5E84-B57A-6347F5A47B88.dita">Namesand fullnames</xref> in reference counting objects.</p> </li></ul></conbody></concept>