Skip to content
Official PYQ · 2013

GATE CS 2013 Q10 — CPU Scheduling

Explain with AI

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 TT 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?

Choose one option
View worked solution

Answer: B

We are given that the priority of a process is directly proportional to its waiting time:

Priority∝Waiting Time\text{Priority} \propto \text{Waiting Time}

Let there be nn processes P1,P2,…,PnP_1, P_2, \dots, P_n that all arrive at time t=0t = 0. Initially, their waiting times are all 00, so they all start with the lowest priority (00).

Let's trace the scheduling decisions made every TT time units:

  1. At t=0t = 0: All processes have a waiting time of 00. The scheduler breaks the tie and selects one process, say P1P_1, to run for TT time units.
  2. At t=Tt = T:
    • P1P_1 has been running, so its waiting time is 00.
    • The remaining processes P2,…,PnP_2, \dots, P_n have been waiting in the ready queue, so their waiting time is TT.
    Since P2,…,PnP_2, \dots, P_n have a higher waiting time (T>0T > 0), they have a higher priority than P1P_1. The scheduler will select one of these waiting processes, say P2P_2, to run for the next TT time units.
  3. At t=2Tt = 2T:
    • P2P_2 has just finished running, so its accumulated waiting time since its last run is 00.
    • P1P_1 has waited for TT time units (from t=Tt = T to 2T2T).
    • The remaining processes P3,…,PnP_3, \dots, P_n have waited for 2T2T time units.
    The processes that have not run at all (P3,…,PnP_3, \dots, P_n) have the highest priority, followed by P1P_1, and P2P_2 has the lowest priority. The scheduler will pick one of the processes that has not run yet.

This pattern continues: each process is allocated exactly TT time units of CPU time in a cyclic order. Once all processes have run once for TT units, the cycle repeats. This behavior is identical to the Round-Robin (RR) scheduling algorithm with a time quantum of TT.

Therefore, the correct option is B.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore CPU Scheduling questions