Question

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 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
Official answer and solution
Official answer
B
From
Official GATE 2013 answer key

Solution

Trace the dynamic priority changes over successive time slices of duration T.

All processes arrive at time 0 with priority 0, and have no I/O operations.

  1. At time t=0t = 0, all processes have priority 0. The scheduler selects one process P1P_1 to run for duration TT.
  2. During interval [0,T][0, T], process P1P_1 executes, so its waiting time remains 0 (priority remains 0).
    All other processes are waiting in the ready queue, so their waiting times increase by TT, increasing their priorities to TT.
  3. At t=Tt = T, the scheduler re-evaluates priorities. The waiting processes all have higher priority (TT) than P1P_1 (priority 0).
    The scheduler picks one of the waiting processes (say P2P_2) to run for duration TT.
  4. During [T,2T][T, 2T], P2P_2 executes, while all other processes (including P1P_1) accumulate waiting time.
  5. In this manner, every process runs for one time slice of duration TT before any previously executed process can run again.

This behavior is identical to Round-Robin scheduling with time quantum TT.

Final answer

Option (B)

Common trap

Confusing this with FCFS, but because all processes arrived at time 0 and execution is interrupted every TT, it cycles periodically like Round-Robin.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2013 Computer Science and Information Technology (CS)
Question
10 of 65, printed as CS Q.10
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.