Loic Domaigne
7/23/2004 10:21:00 AM
Hi Gerry,
> I have some questions about pthreads:
> 1. If i have several processes which create each a pthread,
> do they generate each a unique pthread id ?
Depends what Do you mean by "unique". If you mean "process-wide", yes.
If you mean "system-wide", no... As Joe and Alexander told you.
> 2. If 1==yes, is there a way to find out the process who
> owns a specific pthread id ?
> Suppose process A creates a pthread b. Can process C see that process A
> owns pthread b?
Why would you need such an information? "Normally", it is impossible
from outside to see that a process is multi-threaded!!
[
OK, some OSes can tell you that the process is MT, how many threads
there is etc. But they won't necessary give you the corresponding thread
id, since that information is "local to the process".
]
Cheers,
Loic.