Gate2019 cs Q51

0. Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:

 ProcessP1P2P3P4
 Arrival time0134
 CPU burst time313Z
These processes are run on a single processor using preemptive Shortest Remaining Time First scheduling algorithm. If the average waiting time of the processes is 1 millisecond, then the value of Z is________.

Note – Numerical Type question

  • Option : A
  • Explanation :
    Let’s assume Z = 2, then gantt chart will be,
    P1P2P1P1P4P3 
    0123469

    Average waiting time,
    = {(4-0-3) + (2-1-1) + (9-3-3) + (6-4-2)} / 4
    = (1 + 0 + 3 + 0) / 4
    = 4 / 4
    = 1
    So, answer is 2.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *