First-come-first-served (FCFS) runs processes in arrival order, round robin gives each process a repeated fixed time slice, and priority scheduling runs the highest-priority process first. They differ mainly in how the operating system selects the next process and whether it can interrupt execution.
The Reasoning and Mechanism
The scheduler chooses a process from the ready queue and allocates CPU time. Its scheduling algorithm affects waiting time, response time, fairness, and throughput.
| Algorithm | Selection mechanism | Main consequence |
|---|---|---|
| FCFS | The earliest-arriving ready process runs first; normally non-pre-emptive. | Simple and predictable, but a long process can delay all others: the convoy effect. |
| Round robin | Each ready process receives a time quantum of length . An unfinished process is pre-empted and returned to the queue's end. | Fair and responsive, but context switching creates overhead when is too small. |
| Priority scheduling | The highest-priority ready process runs first; this may be pre-emptive or non-pre-emptive. | Urgent processes run quickly, but low-priority processes may face starvation. Aging prevents this by gradually raising priority. |
Suppose A, B, and C arrive together and require , , and CPU-time units. FCFS executes A, B, C, making short processes wait behind A. With round robin and , execution begins A, B, C, A, A; B and C therefore finish earlier. Priority scheduling follows assigned priorities; equal-priority processes commonly use FCFS.
A common misconception is that round robin gives every process the same total CPU time. It gives each process the same maximum time per turn, not the same total processing time.
IB Exam Technique
For A1.3 Operating systems and control systems, define the selection rule, state whether pre-emption occurs, and explain one consequence. When tracing a schedule, show ready-queue order and calculate waiting or completion times rather than merely naming the algorithm.