Symbian3/SDK/Source/GUID-1EDE641E-EF8C-542D-A7B3-7C496D41EF3D.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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-1EDE641E-EF8C-542D-A7B3-7C496D41EF3D" xml:lang="en"><title>Thread
and Process ID</title><shortdesc>Each thread and process is allocated an ID which is unique across
all threads and processes.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p> The ID is allocated when the thread or process is created. The main motivation
for the ID is to provide assistance for debuggers; it provides an easy way
to identify threads and processes.</p>
<p>In general, applications and servers can use IDs for thread and process
identification or, indeed, for whatever purpose that suits them.</p>
<p>While a thread ID is a property of the thread, it can be retrieved from
the thread by calling <xref href="GUID-B0E661BC-4058-3256-B9C3-5A4FD52F6DE5.dita#GUID-B0E661BC-4058-3256-B9C3-5A4FD52F6DE5/GUID-4B001A02-9F18-376E-868E-A2BB69637ED5"><apiname>RThread::Id()</apiname></xref>. The ID is encapsulated
by a <codeph>TThreadId</codeph> object that is returned by the function.</p>
<p>The <codeph>TThreadId</codeph> class provides <codeph>==</codeph> and <codeph>!=</codeph> operators
for comparing two thread IDs.</p>
<p>The process ID is similar; it can be retrieved from the process by calling <xref href="GUID-9DD1EA2B-DC59-315C-8E9C-CE6D9461B695.dita#GUID-9DD1EA2B-DC59-315C-8E9C-CE6D9461B695/GUID-F35D5AF1-46CC-3F24-AFE6-4539EE470E3D"><apiname>RProcess::Id()</apiname></xref>,
and is encapsulated by a <codeph>TProcessId</codeph> object returned by the
function.</p>
</conbody></concept>