Native POSIX Thread Library: Difference between revisions

Content deleted Content added
Quohx (talk | contribs)
Design: Ce passive voice
Tags: Mobile edit Mobile web edit Advanced mobile edit
Quohx (talk | contribs)
Design: Merge duplicate paragraphs
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 14:
 
==Design==
Like LinuxThreads, NPTL is a 1:1 threads library. Threads created by the library (via ''pthread_create'') correspond one-to-one with schedulable entities in the kernel (''processes'', in the Linux case).<ref name="lsp-love">{{Cite book |title=Linux System Programming |author=Robert Love |edition=2nd |isbn=1449339530 |date=2013}}</ref>{{rp|226}} This is the simplest of the three [[Thread (computing)#Threading models|threading models]] (1:1, N:1, and M:N).<ref name="lsp-love"></ref>{{rp|215–216}} New threads are created with the clone() [[system call]] called through the NPTL library. NPTL relies on kernel support for [[futex]]es to more efficiently implement user-space locks.<ref name="lsp-love"></ref>{{rp|182}}
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]].
 
NPTL is a 1:1 threads library. Threads created by the library (via ''pthread_create'') correspond one-to-one with schedulable entities in the kernel (''processes'', in the Linux case).<ref name="lsp-love">{{Cite book |title=Linux System Programming |author=Robert Love |edition=2nd |isbn=1449339530 |date=2013}}</ref> This is the simplest of the three [[Thread (computing)#Threading models|threading models]] (1:1, N:1, and M:N).<ref name="lsp-love"></ref>
 
==See also==