Message340085
> 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. |
|
Date |
User |
Action |
Args |
2019-04-12 17:17:09 | eryksun | set | recipients:
+ eryksun, gvanrossum, Rhamphoryncus, vstinner, jdemeyer, steve.dower |
2019-04-12 17:17:09 | eryksun | set | messageid: <1555089429.74.0.103933201967.issue36601@roundup.psfhosted.org> |
2019-04-12 17:17:09 | eryksun | link | issue36601 messages |
2019-04-12 17:17:09 | eryksun | create | |
|