A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with zero (the lowest priority). The scheduler re-evaluates the process priorities every 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 zero?
View worked solution
Answer: B
We are given that the priority of a process is directly proportional to its waiting time:
Let there be processes that all arrive at time . Initially, their waiting times are all , so they all start with the lowest priority ().
Let's trace the scheduling decisions made every time units:
- At : All processes have a waiting time of . The scheduler breaks the tie and selects one process, say , to run for time units.
- At :
- has been running, so its waiting time is .
- The remaining processes have been waiting in the ready queue, so their waiting time is .
- At :
- has just finished running, so its accumulated waiting time since its last run is .
- has waited for time units (from to ).
- The remaining processes have waited for time units.
This pattern continues: each process is allocated exactly time units of CPU time in a cyclic order. Once all processes have run once for units, the cycle repeats. This behavior is identical to the Round-Robin (RR) scheduling algorithm with a time quantum of .
Therefore, the correct option is B.
Free practice · Your answers on this page are not saved.
