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
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
|
|
Option: A Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. |