Re: Communication between threads of same PIDs
- From: "karthikbg" <karthik.balaguru@xxxxxxxxxxxxxxx>
- Date: 23 Nov 2006 02:39:09 -0800
Each PID is 32bits, wrapping (modulus) at 30000 for really old
software. If CLONE_PID is not used, each thread will get its own PID
like any other process. However, if the PID is to be shared, the kernel
uses the upper 16bits to assign the thread ID (TID) [please note that
this is probably not in the 2.0.* kernel version; we'll see it in 2.1.*
for sure.]
Furthermore, each process has at least one thread (the parent). Each
new thread will be assigned a TID beginning with 1. A TID of 0 (e.g.
0x0000FFFF mask) will address all threads within a process. Suppose an
app has three threads (parent and two task managers) and the threads
share the parent's PID. Suppose, the PIDs for each might be 0x00011234
(parent), 0x00021234 (child thread #1) and 0x00031234 (child thread
#2). Each thread can be accessed or signaled individually -or- the
whole task could be addressed with 0x00001234 (note that the first four
digits are zero masking the TIDs).
It is the intent that the long format will work with existing apps.
And, older apps that signal the whole task will still work (by
accessing the whole task at once). However a shorthand has been
proposed: PID.TID (e.g. 46.2 would be the second thread of PID 46).
Thx,
Karthik Balaguru
.
- Follow-Ups:
- Re: Communication between threads of same PIDs
- From: Michael Schnell
- Re: Communication between threads of same PIDs
- References:
- Communication between threads of same PIDs
- From: karthikbg
- Re: Communication between threads of same PIDs
- From: Geronimo W. Christ Esq
- Re: Communication between threads of same PIDs
- From: Vicky
- Re: Communication between threads of same PIDs
- From: Geronimo W. Christ Esq
- Re: Communication between threads of same PIDs
- From: Jim Jackson
- Re: Communication between threads of same PIDs
- From: karthikbg
- Communication between threads of same PIDs
- Prev by Date: Re: Terminate and Stay Resident Software (TSR) in Linux
- Next by Date: Re: Communication between threads of same PIDs
- Previous by thread: Re: Communication between threads of same PIDs
- Next by thread: Re: Communication between threads of same PIDs
- Index(es):
Relevant Pages
|