some good intro to multi-threading material, was curious personally how multi-threaded programs are managed by the kernel: cs.uic.edu/~jbell/CourseN.
Conversation
from the page: "Linux does not distinguish between processes and threads - It uses the more generic term "tasks"."
cool, that was easy.
1
6
Replying to
It does have the concept of thread groups and distinguishes between the main thread and secondary threads. They're indeed all implemented as tasks. Passing CLONE_THREAD when spawning a task with clone creates it in the same thread group. A POSIX PID maps to a Linux kernel TGID.
1
2
Check out the description of CLONE_THREAD in the clone(2) man page. It was added in Linux 2.4.0. It's likely that the linked information was likely accurate when it was originally written but hasn't been for quite some time. Linux kernel mostly has proper POSIX thread support.
There's still some trickery required in libc implementations to provide the less granular POSIX semantics. For example, the Linux kernel setuid system call sets uid of the task, not the process as a whole like POSIX setuid. libc implementations do more than wrap the set*id calls.
1
2

