in Unknown Category edited by
347 views
1 vote
1 vote

Consider the following four processes with the arrival time and length of CPU burst given in milliseconds:

$\begin{array}{ccc} \textbf{Process} & \textbf{Arrival Time} & \textbf{Burst Time} \\ P_1 & 0 & 8 \\ P_2 & 1 & 4 \\ P_3 & 2 & 9 \\ P_4 & 3 & 5 \end{array}$

The average waiting time for preemptive SJF scheduling algorithm is ____________

  1. $6.5$ ms
  2. $7.5$ ms
  3. $6.75$ ms
  4. $7.75$ ms
in Unknown Category edited by
by
347 views

1 Answer

2 votes
2 votes

GANTT CHART

t=0      t=1               t=5                 t=10                    t=17           t=26  

   P1       P2           P4       P1     P3

 

$Process$       $AT$        $BT$     TAT= CT-AT   WT=TAT-BT
P1         0          8        17 – 0 =17       9 
P2         1          4         5 – 1=4       0
P3         2          9         26 – 2=24      15
P4         3          5          10 – 3 =7      2 

 

AVG WT=  (9+0+15+2)/4=  6.5 ms

 

 

Answer:

Related questions