Which one or more of the following CPU scheduling algorithms can potentially cause starvation?
- (A)
First-in First-Out
- (B)
Round Robin
- (C)
Priority Scheduling
- (D)
Shortest Job First
Which one or more of the following CPU scheduling algorithms can potentially cause starvation?
First-in First-Out
Round Robin
Priority Scheduling
Shortest Job First
ANSWER
Priority Scheduling (C) and Shortest Job First (D) can cause starvation.
Official answer: A, C, D or C, DSource: Official answer key, GATE 2023 CS (IIT Kanpur)
Starvation means a ready process can wait indefinitely because other processes are always chosen ahead of it.
FIFO (FCFS): the ready queue is served strictly in arrival order. Every process reaches the front after a finite number of earlier arrivals, so no starvation.
Round Robin: each ready process gets a time quantum in cyclic order. With ready processes a process waits at most before its next turn, so no starvation.
Priority scheduling: the highest-priority ready process always runs. A steady stream of higher-priority arrivals can keep a low-priority process waiting forever, so starvation is possible (the usual cure is aging).
Shortest Job First (including its preemptive form SRTF): the shortest burst is always chosen. If short jobs keep arriving, a long job may never be picked, so starvation is possible.
Hence the algorithms that can cause starvation are Priority Scheduling and Shortest Job First, options C and D.
KEY IDEA
Starvation needs a scheduler that can keep choosing other processes ahead of a waiting one forever. Priority and SJF/SRTF do this. FIFO and Round Robin bound every process's waiting time.
WATCH OUT FOR
Thinking only priority scheduling starves, and forgetting that SJF/SRTF starves long jobs when short jobs keep arriving. Another slip is picking FIFO because a long job at the front delays others. That delay is finite, so it is not starvation.
From the GATE 2023 CS paper. Every question of this paper · Download the full paper · All 8 CPU scheduling questions, with notes