Implementing threads in user space

There are two ways to implement a thread's package: in the user space and in the kernel. The choice is moderately controversial and a hybrid implementation, where it is also possible to use a combination of user and kernel thread.

We will now describe these methods, along with their advantages and disadvantages. The first method is to put the threads package entirely in the user space. The kernel knows nothing about them. As far as the kernel is concerned, it is managing ordinary, single-threaded processes. The first and most obvious advantage is that a user-level threads package can be implemented on an operating system that does not support threads.

Traditional operating systems used to fall into this category, ...

Get C++ Multithreading Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.