|
In the GNU/Linux operating system, the Native POSIX Thread Library (NPTL) is a software feature that enables the Linux kernel to run programs written to use POSIX Threads fairly efficiently. The Linux kernel is a Unix-like operating system kernel. ...
POSIX Threads is a POSIX standard for threads. ...
In tests, NPTL succeeded in starting 100,000 threads on a IA-32 in two seconds. In comparison, this test under a kernel without NPTL would have taken around 15 minutes. [1][2] For the form of code consisting entirely of subroutine calls, see Threaded code. ...
It has been suggested that this article or section be merged with X86 assembly language. ...
History
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. For the form of code consisting entirely of subroutine calls, see Threaded code. ...
In computing, a system call is the mechanism used by an application program to request service from the operating system. ...
clone() is a system call on the Linux kernel related to multithreading. ...
In the Linux operating system, LinuxThreads was a partial implementation of POSIX Threads that has since been superseded by the Native POSIX Thread Library (NPTL). ...
The introduction to this article provides insufficient context for those unfamiliar with the subject matter. ...
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: NGPT (Next Generation POSIX Threads) worked on by a team which included developers from IBM, and NPTL by developers at Red Hat. NGPT was abandoned in mid-2003, at about the same time when NPTL was released. IBM redirects here. ...
Red Hat, Inc. ...
Year 2003 (MMIII) was a common year starting on Wednesday of the Gregorian calendar. ...
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 specialized 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. In computing, a system call is the mechanism used by an application program to request service from the operating system. ...
A futex (short for fast userspace mutex) is a basic tool to realize locking and building higher-level locking abstractions such as semaphores and POSIX mutexes on Linux. ...
NPTL is a so-called 1×1 threads library, in that threads created by the user (via the pthread_create() library function) are in 1-1 correspondence with schedulable entities in the kernel (processes, in the Linux case). This is the simplest possible threading implementation. An alternative to NPTL's 1×1 model is the m×n model where there are typically more userland threads than schedulable entities. In this implementation, the threading library is responsible for scheduling user threads on the available schedulable entities; this makes context switching of threads very fast, as it avoids system calls. However, this increases complexity and the likelihood of priority inversion, as well as suboptimal scheduling without extensive (and expensive) coordination between the userland scheduler and the kernel scheduler. A context switch is the computing process of storing and restoring the state (context) of a CPU such that multiple processes can share a single CPU resource. ...
In scheduling, priority inversion is the inverting the relative priorities of the two tasks. ...
NPTL was first released in Red Hat Linux 9. Old-style Linux POSIX threading is known for having trouble with threads that refuse to yield to the system occasionally, because it does not take the opportunity to preempt them when it arises, something that Windows was known to do better at the time. Red Hat claimed that NPTL fixed this problem in an article on the Java website about Java on Red Hat Linux 9. Java is a programming language originally developed by Sun Microsystems and released in 1995. ...
NPTL has been part of Red Hat Enterprise Linux since version 3, and is now a fully integrated part of glibc. Red Hat Enterprise Linux (often abbreviated to RHEL) is a Linux distribution produced by Red Hat and targeted toward the commercial market, including mainframes. ...
Glibc is the GNU projects C standard library. ...
Determining version Because NPTL is being introduced gradually to different distributions of Linux, and in particular patched versions of Red Hat Linux, one command line test to determine the presence in the kernel is: getconf GNU_LIBPTHREAD_VERSION This will report the default threading library on any distribution of Linux. If getconf is not available (i.e. on some embedded systems), executing /lib/libc.so.6 may provide the required information.
See also Image File history File links This is a lossless scalable vector image. ...
Illustration of an application which may use libvorbisfile. ...
Linux (IPA pronunciation: ) is a Unix-like computer operating system. ...
References - ^ http://www.linuxjournal.com/article/6530
- ^ http://people.redhat.com/drepper/nptl-design.pdf
External links - NPTL Design paper
- NPTL Trace Tool OpenSource tool to trace and debug multithreaded applications using the NPTL.
- Linux threading models compared: LinuxThreads and NPTL
|