Linux System Programming by Robert Love

Linux System Programming by Robert Love

Author:Robert Love
Language: eng
Format: mobi, epub
Tags: COMPUTERS / Operating Systems / UNIX
ISBN: 9781449339517
Publisher: O’Reilly Media
Published: 2013-05-14T03:00:00+00:00


Hybrid Threading

What if we combine kernel- and user-level threading? Is it possible to achieve the true parallelism of the 1:1 model with the free context switches of the N:1 model? Indeed it is, if you are willing to accept quite a bit of complexity. N:M threading, also known as hybrid threading, attempts to achieve the best of both worlds: the kernel provides a native thread concept, while user space also implements user threads. User space, perhaps in conjunction with the kernel, then decides how to map N user threads onto M kernel threads, where N>=M.

Approaches differ by implementation, but the typical strategy is to not back most of the user threads with a kernel thread. A process might contain hundreds of user threads but only a small number of kernel threads, with that small number a function of processors (with at least one kernel thread for each processor enabling the full utilization of the system) and blocking I/O. As you might imagine, this model is rather complex to implement. Given Linux’s cheap context switches, most system developers do not feel this approach worthwhile and the 1:1 model remains popular for Linux.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.