October 2017
Intermediate to advanced
586 pages
14h 8m
English
Sleeping is the mechanism by which a process relaxes a processor, with the possibility of handling another process. The reason why a processor sleeps could be for sensing data availability, or waiting for a resource to be free.
The kernel scheduler manages a list of tasks to run, known as a run queue. Sleeping processes are not scheduled anymore, since they are removed from that run queue. Unless its state changes (that is, it wakes up), a sleeping process will never be executed. You may relax a processor as soon as you are waiting for something (a resource or anything else), and make sure a condition or something else will wake it up. That said, the Linux kernel simplifies the implementation of the sleeping ...