Operating System

1:

Consider a set of 5 processes whose arrival time. CPU time needed and the priority are given below
 

Process Priority Arrival Time (in ms) CPU Time Needed (in ms) Priority
P1 0 10 5
P2 0 5 2
P3 2 3 1
P4 5 20 4
P5 10 2 3


smaller the number, higher the priority.

If the CPU scheduling policy is SJF with pre-emption, the average waiting time will be

A.

8 ms

B.

14 ms

C.

6 ms

D.

none of these

 

Answer : C

Explanation :

Scheduling order will be

P2    ,     P3    , P1     ,  P5    , P1,  P4
Waiting time of processes will be
P2 = 0
P3= 5-2=3
P1=10+2=12
P5=0
P4= 15
Average waiting time will be  = (0+3+12+0+15)/5= 30/5=6ms

 

Preeti Sharma said: (1:40am on Saturday 26th May 2018)
waiting time fpr p1=10,p2=3,p3=0,p4=15,p5=0average waiting time=(10 3 0 15 0)/5= 28/5 =5.6ms

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.