Sample Header Ad - 728x90

Are tid and tgid always the same as pid in the output of ps?

5 votes
1 answer
3110 views
In manpage of ps tid TID the unique number representing a dispatchable entity (alias lwp, spid). This value may also appear as: a process ID (pid); a process group ID (pgrp); a session ID for the session leader (sid); a thread group ID for the thread group leader (tgid); and a tty process group ID for the process group leader (tpgid). tgid TGID a number representing the thread group to which a task belongs (alias pid). It is the process ID of the thread group leader. In Ubuntu, tid and tgid seem always the same as pid, for both user processes, and kernel threads (I run ps -o pid,tid,tgid,cmd) Is it true in Linux, and why? Is it true in other Unix such as System V or BSD? Thanks.
Asked by Tim (106430 rep)
Dec 29, 2018, 08:35 PM
Last activity: Dec 29, 2018, 11:26 PM