Anonymous user menu

SRTF algorithm

Consider the following set of processes,with the arrival times and the CPU-burst times given in milliseconds

Process Arrival Time Burst Time
P1 0 5
P2 1 3
P3 2 3
P4 4 1

What is the average turnarround time for these processes with the preemptive Shortest Remaining Processing Time First(SRTF) algorithm?

a. 5.50            b. 5.75             c. 6.00           d. 6.25

Answer

turnarround time = compilation time - arrival time 

average turnarround time =total turnarround time / total no. of process

create gantt chart

P1 P2 P4 P3 P1

0                   1                    4                    5                     8                     12

 turnarround time(P1) = 12-0 =12

 turnarround time(P2) = 4-1 = 3

 turnarround time(P3) = 8-2 = 6

 turnarround time(P4) = 5-4 = 1

average turnarround time = 22/4

                                         =5.50,SO ans is a.

0Comment