Thread (computing): Difference between revisions

Content deleted Content added
Avoid redirect.
Keep the symbol usage consistent. If M is application threads, and N is kernel entities, many application threads (M) mapped to one kernel entity/thread (N) shold be M:1. See also: https://www.ibm.com/docs/en/aix/7.3?topic=processes-thread-models-virtual-processors
Line 71:
Threads created by the user in a 1:1 correspondence with schedulable entities in the kernel<ref name="OSConcepts">{{Cite book |first1=Abraham |last1=Silberschatz |author-link1=Abraham Silberschatz |first2=Peter Baer |last2=Galvin |first3=Greg |last3=Gagne |title=Operating system concepts |publisher=Wiley |year=2013 |isbn=9781118063330 |edition=9th |___location=Hoboken, N.J. |pages=170–171}}</ref> are the simplest possible threading implementation. [[OS/2]] and [[Win32]] used this approach from the start, while on [[Linux]] the [[GNU C Library]] implements this approach (via the [[Native POSIX Thread Library|NPTL]] or older [[LinuxThreads]]). This approach is also used by [[Solaris (operating system)|Solaris]], [[NetBSD]], [[FreeBSD]], [[macOS]], and [[iOS]].
 
====''NM'':1 (user-level threading)====
An ''NM'':1 model implies that all application-level threads map to one kernel-level scheduled entity;<ref name="OSConcepts" /> the kernel has no knowledge of the application threads. With this approach, context switching can be done very quickly and, in addition, it can be implemented even on simple kernels which do not support threading. One of the major drawbacks, however, is that it cannot benefit from the hardware acceleration on [[Multithreading (computer hardware)|multithreaded]] processors or [[Multiprocessing|multi-processor]] computers: there is never more than one thread being scheduled at the same time.<ref name="OSConcepts" /> For example: If one of the threads needs to execute an I/O request, the whole process is blocked and the threading advantage cannot be used. The [[GNU Portable Threads]] uses User-level threading, as does [[State Threads]].
 
====''M'':''N'' (hybrid threading)====