You are on page 1of 1

a) Based on the above information, Draw a Gantt chart for the following algorithms :

b) Compute the following using Shortest Remaining Time :

i.Response time ii.Throughput

P1 = 0 Total processes = 6 (P1, P2, P3, P4, P5, P6)


P3 = 2 (starts at time 2) Total time taken = 14 milliseconds
P4 = 4 (starts at time 4) Throughput = Total processes / Total time taken =
P5 = 7 (starts at time 7) 6 / 14 = 0.428 processes/millisecond
P6 = 9 (starts at time 9)
P2 = 10 (starts at time 10)

iii.Average Waiting Time iv.Average Turnaround Time

P1 = 0 (No waiting) P1 = 3 (Completes at time 3)


P3 = 0 (No waiting) P3 = 1 (Completes at time 3)
P4 = 1 (Starts waiting at time 3) P4 = 3 (Completes at time 7)
P5 = 2 (Starts waiting at time 7) P5 = 4 (Completes at time 11)
P6 = 1 (Starts waiting at time 9) P6 = 3 (Completes at time 10)
P2 = 6 (Starts waiting at time 4) P2 = 12 (Completes at time 14)
Total waiting time = 0 + 0 + 1 + 2 + 1 + 6 = 10 Total turnaround time = 3 + 1 + 3 + 4 + 3 + 12 =
milliseconds 26 milliseconds
Average waiting time = Total waiting time / Average turnaround time = Total turnaround
Total processes = 10 / 6 = 1.67 milliseconds time / Total processes = 26 / 6 = 4.33 milliseconds

You might also like