Content deleted Content added
m Date maintenance tags and general fixes: build 532: |
|||
Line 3:
In tests, NPTL succeeded in starting 100,000 [[Thread (computer science)|threads]] on a [[IA-32]] in two seconds. In comparison, this test under a Linux kernel without NPTL would have taken around 15 minutes.<ref>[http://www.linuxjournal.com/article/6530 Introducing the 2.6 Kernel<!-- Bot generated title -->]</ref><ref>[http://people.redhat.com/drepper/nptl-design.pdf The Native POSIX Thread Library for Linux<!-- Bot generated title -->]</ref>
==
Before the 2.6 version of the [[Linux kernel]], processes were the schedulable entities, and there was no real support for [[Thread (computer science)|threads]]. However, it did support a [[system call]] — <tt>[[clone (Linux system call)|clone]]</tt> — 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 provide kernel-level thread support (most of the previous pthread implementations in Linux worked entirely in [[Userland (computing)|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.
Line 11 ⟶ 10:
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 (programming language)|Java]] website about Java on Red Hat Linux 9.<ref>[http://java.sun.com/developer/technicalArticles/JavaTechandLinux/RedHat/ Red Hat Linux 9 and Java 2 Platform, Standard Edition 1.4.2: A Winning Combination]</ref>
NPTL has been part of [[Red Hat Enterprise Linux]] since version 3, and in the Linux kernel since version 2.6. It is now a fully integrated part of the [[GNU C Library]].{{
There exists a tracing tool for NPTL, called [http://nptltracetool.sourceforge.net/ POSIX Thread Trace Tool] ([http://sourceforge.net/projects/nptltracetool/ PTT]). And an [http://posixtest.sourceforge.net/ Open POSIX Test Suite] ([http://sourceforge.net/projects/posixtest/ OPTS]) was written for testing the NPTL library against the POSIX standard.
==
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 wake again. The primitive used for this is known as a [[futex]].
Line 23 ⟶ 21:
An alternative to NPTL's 1×1 model is the [[Thread_%28computer_science%29#N:M_.28Hybrid_threading.29|''m×n'' model]]
==
{{Portal|Free software}}
Line 31 ⟶ 29:
==References==
{{Reflist}}
|