Skip to main content

GATE CSE 2013Operating System › CPU SchedulingVerified

GATE CSE 2013 PYQ: A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts…

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?

  1. A
    This algorithm is equivalent to the first-come-first-serve algorithm.
  2. B
    This algorithm is equivalent to the round-robin algorithm.
    Correct answer
  3. C
    This algorithm is equivalent to the shortest-job-first algorithm.
  4. D
    This algorithm is equivalent to the shortest-remaining-time-first algorithm.

Answer

(B) This algorithm is equivalent to the round-robin algorithm.

Approach

Model the priority rule as a function of waiting time and simulate a small set of CPU-bound processes that all arrive at time 0. Observe which process is chosen after each T-unit interval and compare the resulting schedule with the standard algorithms.

With all processes arriving at time 0 and no I/O, the priority rule based on waiting time prevents any process from monopolizing the CPU for more than T units. After each T-unit interval, the process that just ran has the smallest waiting time, while the others have larger waiting times, so the scheduler cycles through the ready processes in order. This is precisely round-robin scheduling with time quantum T.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.