It's important to realize that the Linux kernel does not have just one algorithm that implements CPU scheduling; the fact is, the POSIX standard specifies a minimal three scheduling policies (algorithms, in effect) that a POSIX-compliant OS must adhere to. Linux goes above and beyond, implementing these three as well as more, with a powerful design called scheduling classes (more on this in the Understanding modular scheduling classes section later in this chapter).
Again, information on the POSIX scheduling policies on Linux (and more) is covered in more detail in my earlier book, Hands-On System Programming with Linux, published by Packt in October 2018.
For now, let's just briefly summarize the POSIX scheduling policies and what effect they have in the following table:
Scheduling policy | Key points | Priority scale |
SCHED_OTHER or SCHED_NORMAL |
Always the default; threads with this policy are non... |