In this chapter, we covered important concepts related to CPU scheduling on Linux and real-time. The reader has been taken through progressive topics on the Linux thread state-machine, real-time, CPU affinity, and the available POSIX scheduling policies. Furthermore, we have shown APIs—both at the pthreads and system call layers—to exploit these powerful mechanisms. A demo application reinforced the concepts that we learned. Finally, a quick note on the fact that Linux can also be used as a hard real-time (RTOS) was covered.
In the next chapter, the reader will be shown how to achieve the best I/O performance using modern techniques.