An operating system uses shortest remaining time (SRT) scheduling algorithm. Consider the arrival times and execution time for the following processes: Proces Arrival Time Execution Time P1 0 20 P2 15 25 P3 30 10 P4 45 15 What is total waiting time for process P2?

An operating system uses shortest remaining time (SRT) scheduling algorithm. Consider the arrival times and execution time for the following processes: Proces Arrival Time Execution Time P1 0 20 P2 15 25 P3 30 10 P4 45 15 What is total waiting time for process P2? Correct Answer 15

Shortest remaining time (SRT)  is pre-emptive algorithms

Gantt chart:

P1

P2

P3

P2

  P4

0      20      30      40     55      70

Process Table:

Process

Arrival Time

Execution Time (Burst Time)

Completion Time  Turnaround time  Waiting time

P1

0

20

     

P2

15

25

55 40 15

P3

30

10

     

P4

45

15

     
 

Explanation:

Completion time For P2 =55

Turn around time (TAT) = Completion time - Arrival time = 55 -15 = 40

Waiting Time for P2  = TAT-Execution Time = 40- 25 =15

Therefore waiting time P2 is 15 unit:

Related Questions

A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities everyT time units and decides the next process to schedule. Which one of the following is TRUE if theprocesses have no I/O operations and all arrive at time zero?