os cpu scheduling questions jjj
os cpu scheduling questions jjj
1. What is the average waiting time and turnaround time for the process given in table
using Shortest Job first policy?
Solution:
2. What is the average waiting time and turnaround time for the process given in table
using Shortest Remaining Time First?
P1 0 4 2
P2 1 3 3
P3 2 1 4
P4 3 5 5
P5 4 2 5
Soln
Here, Exit time is same as completion time
Now,
Average Turn Around time = (4 + 14 + 10 + 6 + 7) / 5 = 41 / 5 = 8.2 unit
Average waiting time = (0 + 11 + 9 + 1 + 5) / 5 = 26 / 5 = 5.2 unit
6. Consider the set of 5 processes whose arrival time and burst time are given below-If
the CPU scheduling policy is Round Robin with time quantum = 2 unit, calculate the
average waiting time and average turn around time.
P1 0 5
P2 1 3
P3 2 1
P4 3 2
P5 4 3
Soln
Now,
Average Turn Around time = (13 + 11 + 3 + 6 + 10) / 5 = 43 / 5 = 8.6 unit
Average waiting time = (8 + 8 + 2 + 4 + 7) / 5 = 29 / 5 = 5.8 unit
Here exit time means completion time.