Re: Communication between threads of same PIDs



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

.



Relevant Pages

  • RE: Application modes and COM application
    ... Expand Component Services -> Computers -> My Computer ... Click on COM+ Applications. ... You'll see a list of all your COM+ apps. ... There is a column called PID ...
    (microsoft.public.inetserver.iis)
  • Re: Assigning a PID to a given program?
    ... One I think might have been in question was when I was rebuilding ... my sendmail configs. ... Could you name the apps, ... > they're looking for a particular PID? ...
    (freebsd-questions)
  • Re: How to get process id of active task?
    ... I want to do an app that logs the different applicationsa that have been ... I do not want to know when the user started the apps. ... Using the Process class you can get a hold of other ... >> I want to know the pid of the application that the user interacts with. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Assigning a PID to a given program?
    ... > program running on a particular PID (don't ask me why. ... Could you name the apps, ... In Googlis non est, ergo non est. ...
    (freebsd-questions)
  • Re: kern/134011: [hang] swap_pager_getswapspace(4): failed
    ... Tracing pid 148 tid 100134 td 0xffffff000639d390 ... Tracing command nfprofile pid 3400 tid 100316 td 0xffffff0076469000 ... _sleep() at _sleep+0x2fe ...
    (freebsd-current)