This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Rhamphoryncus, eryksun, gvanrossum, jdemeyer, steve.dower, vstinner
Date 2019-04-12.17:17:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555089429.74.0.103933201967.issue36601@roundup.psfhosted.org>
In-reply-to
Content
> Maybe a similar thing exists in Linux? 

Back in the late 90s, Linux implemented threads as 'processes' (LinuxThreads), but with shared resources such as virtual memory and file descriptors. (The Linux kernel's clone system call is highly composable in this regard.) Thus getpid() was different for each thread in a process and kill() could target a particular thread-process. I guess it was a problem if Ctrl+C in a terminal would send SIGINT to every thread-process associated with the terminal.

Eventually, for scalability and POSIX compliance, Linux abandoned the LinuxThreads implementation. It evolved kernel process IDs into thread IDs and a new concept called a thread group emerged. Nowadays all threads in a process are in the same thread group, and the PID returned by getpid() is the thread-group ID (TGID), which is the thread ID (TID) of the first thread in the process. clone() defaults to creating a new process (thread group), unless CLONE_THREAD is specified.
History
Date User Action Args
2019-04-12 17:17:09eryksunsetrecipients: + eryksun, gvanrossum, Rhamphoryncus, vstinner, jdemeyer, steve.dower
2019-04-12 17:17:09eryksunsetmessageid: <1555089429.74.0.103933201967.issue36601@roundup.psfhosted.org>
2019-04-12 17:17:09eryksunlinkissue36601 messages
2019-04-12 17:17:09eryksuncreate