##### Shortest Remaining Time First

An operating system uses Shortest Remaining Time First(SRT) process scheduling algo.Consider the arrival times and execution times for the following processes:

Process                  Execution Time                  Arrival Time

P1                                20                                     0

P2                                25                                    15

P3                                10                                    30

P4                                15                                    45

What is the total waiting time for process P2?

SRT- which process have shorted execution time take CPU first with respect to arrival time.

 P1(0-20) P2(20-30) P3(30-40) P2(40-55) P4(55-70

waiting time(P2)=Compilation Time - Arrival Time - CPU Burst

= 55-15-25

=15

##### 1Comment
Mohit Lalwani
27 Jun 2016 09:30 pm

Gantt Chart;

|_p1__|__p1__|__p2___|___p3___|___p2____|______p4_______|
0       15         20           30            40               55                           70

find waiting time of p2;

Waiting time =completion time-execution time-arrival time;
=  55-25-15;
=  15