A scheduling algorithm assigns priority proportional to the waiting time of a…
2013
A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities every T time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time 0?
- A.
This algorithm is equivalent to the first-come-first-serve algorithm.
- B.
This algorithm is equivalent to the round-robin algorithm.
- C.
This algorithm is equivalent to the shortest-job-first algorithm.
- D.
This algorithm is equivalent to the shortest-remaining-time-first algorithm.
Attempted by 26 students.
Show answer & explanation
Correct answer: B
Concept
Two structural properties of a scheduler fully decide which classical policy it mimics: (1) whether it is preemptive (can interrupt a running process at fixed intervals) or non-preemptive, and (2) what quantity it ranks processes by - elapsed waiting time, total burst length, or remaining burst length. A policy that periodically interrupts the CPU and always favours the process that has waited longest is, by definition, time-sliced fair rotation.
Application
The scheduler re-evaluates priorities every T time units and may switch the running process at each boundary, so it is PREEMPTIVE with a fixed time quantum equal to T.
Priority is proportional to WAITING time, not to burst length or remaining burst, so the ranking key is time spent waiting - never the size of the job.
All processes arrive at t = 0 and start with equal (zero) waiting time. During its slice a running process accumulates zero additional waiting time, while every other ready process accumulates exactly T more - so the just-run process ends the slice with the SMALLEST accumulated waiting time of all.
Because priority is proportional to (accumulated) waiting time, having the smallest waiting time means the just-run process now has the LOWEST priority, so it is placed behind everyone else; the process that has waited longest is dispatched next.
After every process has had one slice they have all accumulated the same waiting time and are tied again, so the next cycle repeats the same rotation. Ties are broken consistently - whichever ready process has waited longest without a turn goes next - so no process is skipped or repeated out of turn. This produces exactly round-robin's rotation with quantum T: each still-ready process gets one turn of up to T time units (a full quantum, or less if its remaining burst finishes first), after which control passes to the next-longest-waiting ready process - regardless of individual burst lengths.
Cross-check / contrast
First-come-first-serve is non-preemptive: once a process starts it runs to completion. The described scheduler preempts every T units, so it is not FCFS.
Shortest-job-first ranks by total burst length and is non-preemptive; this scheduler never looks at burst length and does preempt, so it is not SJF.
Shortest-remaining-time-first ranks by remaining burst length; this scheduler ranks by waiting time and ignores burst entirely, so it is not SRTF.
Only round-robin matches both signatures: preemptive, fixed quantum T, and rotation driven by who has waited longest.