Re: PID <-> TID mapping?

[email protected]
Newsgroups gmane.linux.ngpt.devel
Message-ID <[email protected]>
On 06/28/2002 at 06:46:03 PM ZE2, Jan Glauber <[email protected]>
wrote:

>
> I'm working on a process migration project and wonder if NGPT
> have (in difference to pthreads) a mechanism to assign a given
> tid to a thread. I implemented thread migration for pthreads
> but there are problems with changing PID's (pthread library
> holds a mapping between PID - TID).

In NGPT, pthread_self with return the id of the lightweight userspace
thread.  If you desire the PID of the process, getpid() will return the
same pid from any thread it's called from (unless default LinuxThreads), if
(for some reason) you want the id of the kernel thread (clone in Linux
terms), you can use the gettid() system call.

Hope this helps.

>
> Are the TID's in NGPT used the same way like PID's or are there
> differences?
>

There are differences, see above...


Regards,
     Bill Abt
     Senior Software Engineer
     Next Generation POSIX Threading for Linux
     IBM Cambridge, MA, USA 02142
     Ext: +(00)1 603-673-3440
     T/L: 253-9938
     Cell: +(00)1 617-803-7514
     [email protected] or [email protected]
     http://oss.software.ibm.com/developerworks/opensource/pthreads
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.