Eryk Sun <eryk...@gmail.com> added the comment:

> 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.

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36601>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to