Process scheduling 2026-10-13
Process scheduling chooses which runnable operating-system process or software thread uses a CPU next, and when it gives up that CPU. Runnable means able to execute now; work waiting for an input-output operation is not eligible until that wait ends. A ready queue records eligible work. The policy chooses a recipient; a context switch supplies the mechanism for transferring execution. Sharing a single CPU lets a long calculation and an interactive program both make progress, although only one execution stream runs on that CPU at an instant.
Consider three single-software thread operating-system processes on one CPU, with abstract time units, zero context switch or scheduler overhead, and no input-output blocking. Their arrival times and CPU bursts are , and . Each CPU burst is all the execution that its task needs. With FCFS, the current task runs to completion: A occupies , B and C . With round-robin scheduling and scheduling quantum , the intervals are A , B , C , A , B and A . At a boundary, arrivals join the ready queue before the unfinished task whose scheduling quantum has expired; this fixes the otherwise ambiguous ordering at time 2.
The following triples always list A, B, C. Completion is an absolute time; scheduling turnaround time, scheduling waiting time and scheduling response time are durations measured from the relevant events.
For example, B first runs at time 2 under round-robin scheduling, so its scheduling response time is . It finishes at time 8, giving scheduling turnaround time and scheduling waiting time . Under FCFS, C waits before its sole execution interval. Under round-robin scheduling, A waits during and , totaling . Both timelines do exactly units of useful CPU work; changing the order changes who benefits first.
The appeal is that shared progress can improve responsiveness: B and C get their first CPU service sooner under round-robin scheduling, while A completes later. The arithmetic mean of the scheduling response times falls from to ; the arithmetic mean of the scheduling turnaround times is for both policies in this particular example. These are different goals, and this workload establishes no universal ranking. Giving each continuously runnable task repeated turns is a practical form of fairness. A smaller scheduling quantum can shorten waits between turns, but makes context switches more frequent when competitors remain runnable. If each full slice performs units of useful work and incurs a fixed switching cost , the overhead fraction in that simplified repeated cycle is . Real costs and workloads determine the choice. [ref]
Ready queue 2026-10-13
A collection of runnable operating-system processes or software threads waiting for a CPU. A running task is not waiting in the ready queue, and a task waiting for input-output is not runnable. FCFS and round-robin scheduling can use a FIFO queue; other policies can organize eligible work differently, for example with a priority queue.
Round-robin scheduling 2026-10-13
Serve the front of a FIFO queue of runnable tasks for at most one scheduling quantum. If the task finishes or must wait for input-output, it leaves the CPU earlier; if it remains runnable after consuming its allowance, append it to the rear of the ready queue. In the example under process scheduling, the ready queue at time 2 is B, C, A: B arrived at time 1, C joins at the boundary, then A is requeued. That one convention determines the subsequent order.
