Home » Operating Systems » Operating systems miscellaneous » Question

Operating systems miscellaneous

  1. Consider the following CPU processes with arrival times (in milliseconds) and length of CPU bursts (in milliseconds) as given below:

    If the pre-emptive shortest remaining time first scheduling algorithm is used to schedule the processes, then the average waiting time across all processes is _______ milliseconds.
    1. 1
    2. 3
    3. 5
    4. 11
Correct Option: B


So, turn around time is for P1 ,P2 ,P3 ,P4 are :
P1 ⇒ (12 - 0) , P2 ⇒ (6 - 3), P3 ⇒ (17 - 5) , P4 ⇒ (8 - 6),
⇒ P1 = 12 , P2 = 3 , P3 = 12 , P4 = 2
As we know that Waiting time = Turn around time - Burst time
So, waiting time for P1 ,P2 ,P3 ,P4 are :
P1 ⇒ (12 - 7) = 5
P2 ⇒ (3 - 3) = 0
P3 ⇒ (12 - 5) = 7
P4 ⇒ (2 - 2) = 0

Hence, avg. waiting time =
P1 + P2 + P3 + P4
=
5 + 7
= 3.0
44



Your comments will be displayed only after manual approval.