O'Reilly logo

C++ Multithreading Cookbook by Milos Ljumovic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing threads in the kernel

The entire kernel is a process with a lot of system (kernel) threads running in its context. The kernel has a thread table that keeps track of all the threads in the system.

The kernel maintains the traditional process table to keep track of processes. Function calls that can block a thread are executed as system calls, at much greater cost than the executing system procedure. When a thread blocks, the kernel must run another thread. When a thread is destroyed, it is marked as not runnable—but its kernel data structures are not otherwise affected. Afterwards, when a new thread needs to be created, an old thread is reactivated, recycling resources for usage. Thread recycling is also possible for user-level threads, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required