Native POSIX Thread Library: Difference between revisions

Content deleted Content added
mNo edit summary
Serprex (talk | contribs)
Links are better than pasta
Line 21:
NPTL is a so-called 1×1 threads library, in that threads created by the user (via the <code>pthread_create()</code> library function) are in 1-1 correspondence with schedulable entities in the kernel (tasks, in the Linux case). This is the simplest possible threading implementation.
 
An alternative to NPTL's 1×1 model is the [[http://en.wikipedia.org/wiki/Thread_%28computer_science%29#N:M_.28Hybrid_threading.29|''m×n'' model]]
An alternative to NPTL's 1×1 model is the ''m×n'' model where there are typically more userland threads than schedulable entities. In the ''m×n'' implementation, the threading library is responsible for scheduling user threads on the available schedulable entities; this makes [[context switch]]ing of [[Thread (computer science)|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.
 
== See also ==