> threads belonging to same group have thread group id tgid stored in kernel stack of that process,The identifier shared by the threads is the PID of the thread group leader , that is, the PID of the first lightweight process in the group > This is done to comply with POSIX standards that all threads of a multithreaded application must have the same PID. > > regards > Pushparaj
The tgid in task_struct have the same pid (the pid of the thread group leader) in them. Hence though all threads in a group have **different pid (as any other process) they have the same tgid to indicate they are threads** And to comply with POSIX the ** the getpid() sys call would return the value of tgid instead of pid when it is a thread**
Thanks in advance. Another question, what's the thread id returned by pthread_self() ? Is there an field in task_struct ? Regard, Cheng -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/