Content deleted Content added
posix threads |
m →History: "of course" sounds a little biased imo |
||
Line 6:
Before the 2.6 version of the linux kernel, processes were schedulable entities, and there was no real support for threads. However, it did support a system call - clone() - which creates a copy of the calling process, where the copy shares the address space of the caller. The [[LinuxThreads]] project used this system call to simulate thread support entirely in userland. Unfortunately, it had a number of issues with true POSIX compliance, particularly in the areas of signal handling, scheduling, and inter-process synchronization primitives.
To improve upon LinuxThreads, it was clear that some kernel support and a re-written threads library would be required. Two competing projects were started to address the requirement
NPTL uses a similar approach to LinuxThreads, in that the primary abstraction known by the kernel is still a process, and new threads are created with the clone() [[system call]] (called from the NPTL library). However, NPTL requires specialised kernel support to implement (for example) the contended case of synchronisation primitives which might require threads to sleep and be re-awoken. The primitive used for this is known as a [[futex]].
|