edited by
367 views
1 votes
1 votes

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
edited by

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

1 votes
1 votes
3 answers
1
Arjun asked Nov 5, 2017
878 views
Which of the following routing technique / techniques is/are used in distributed systems?Fixed RoutingVirtual RoutingDynamic Routing(a) only(a) and (b) only(c) onlyAll (a...
1 votes
1 votes
2 answers
3
Arjun asked Nov 5, 2017
963 views
The Sigmoid activation function $f(t)$ is defined as$\dfrac{1}{\text{exp} (t) + \text{exp} (-t)}$$t \text{ exp}(-t)$$\dfrac{1}{1+ \text{exp} (t)}$$\dfrac{1}{1+ \text{exp...