Q59: Least average waiting time

Question #59: If there are 4 processes in the system namely P1, P2, P3, P4 with the CPU burst time of 1ms, 2ms, 3ms, and 4ms respectively. They arrive at the same time in order of P3, P2, P4, P1. Which of the following scheduling policy will yield the least average waiting time?

 

Options:

  1. Shortest Job First
  2. First come first serve
  3. All scheduling policies yield the same average waiting time.
  4. None of the above

 

Solution:

SJF yields the least waiting time when all of the processes arrive at the same time. For SJF, waiting time is (0 + 1 + 3 + 6) / 4 = 2.5ms. For FCFS, it is (9 + 3 + 0 + 5 ) / 4 = 4.25ms. Hence, the correct answer is option 1.