译者:LeeFJ SYMBIAN OS SDK V8.1A
--------------------------------------------------------------------------------
» Symbian OS SDK v8.1a » Symbian OS guide » Base » Using User Library (E32) » Thread And Process Management » Using Threads and Processes » Thread and process Id
--------------------------------------------------------------------------------
Thread and process ID 线程和进程 ID
Each thread and process is allocated an ID which is unique across all threads and processes. The ID is allocated when the thread or process is created. 每一个进程和线程都会分配一个在所有进程和线程中唯一的ID,这个ID在进程或线程创建的时候分配。
The main motivation for the ID is to provide assistance for debuggers; it provides an easy way to identify threads and processes. 之所以使用ID,因为它对于调试有一定的帮助,它提供了一个简单的方法来确定进程或线程。 In general, applications and servers can use IDs for thread and process identification or, indeed, for whatever purpose that suits them. 通常,应用程序和服务器可以使用ID来识别进程和线程,或者还可以做任何其他需要的使用。
While a thread ID is a property of the thread, it can be retrieved from the thread by calling RThread::Id(). The ID is encapsulated by a TThreadId object that is returned by the function. 线程ID是线程的一个属性,它可以通过调用RThread::Id()方法获取。ID被封装在TThreadId对象当中,通过函数返回。 The TThreadId class provides == and != operators for comparing two thread IDs. TThreadId 类提供了==和!=操作符对两个ID进行比较。
The process ID is similar; it can be retrieved from the process by calling RProcess::Id(), and is encapsulated by a TProcessId object returned by the function. 进程ID也是类似的。它可以通过调用RProcess::Id()函数返回,并且被封装在TProcessId 对象中。
-------------------------------------------------------------------------------- Copyright ©2005 Symbian Ltd. unknown-build-id
|