Chapter 6. Advanced Process Management
Chapter 5 introduced the abstraction of the process, and discussed the kernel interfaces used to create, control, and destroy it. This chapter builds on those ideas, beginning with a discussion of the Linux process scheduler and its scheduling algorithm, and then presenting advanced process management interfaces. These system calls manipulate the scheduling behavior and semantics of a process, influencing the scheduler’s behavior in pursuit of an application or user-dictated goal.
Process Scheduling
The process scheduler is the component of a kernel that selects which process to run next. In other words, the process scheduler—or simply the scheduler—is the subsystem of the kernel that divides the finite resource of processor time among a system’s processes. In deciding which processes can run and when, the scheduler is responsible for maximizing processor usage while simultaneously providing the impression that multiple processes are executing concurrently and seamlessly.
In this chapter, we will talk a lot about runnable processes. A runnable process is one that, first of all, is not blocked. Processes that interact with users, read and write files heavily, or respond to I/O or network events, tend to spend a lot of time blocked while they wait for resources to become available, and they are not runnable during those long periods (long, that is, compared to the time it takes to execute machine instructions). A runnable process must also have ...
Get Linux System Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.