Which ONE of the following correctly gives the average turnaround time of the four processes in milliseconds?
Correct : d
The correct answer is Option D — 19 milliseconds.
Let''s trace the SRTF Gantt chart step by step.
Given: P1(arrival=0, burst=10), P2(arrival=1, burst=13), P3(arrival=2, burst=6), P4(arrival=8, burst=9)
t=0: Only P1 available → P1 runs. Remaining: P1=9.
t=1: P2 arrives (burst=13). P1 remaining=9 < 13 → P1 continues.
t=2: P3 arrives (burst=6). P1 remaining=8, P3=6 → P3 preempts P1.
t=2 to t=8: P3 runs for 6ms → P3 completes at t=8.
t=8: P4 arrives (burst=9). Ready queue: P1(remaining=8), P2(remaining=13), P4(9). Shortest is P1(8) → P1 runs.
t=8 to t=16: P1 runs for 8ms → P1 completes at t=16... wait — P1 had 10 burst, ran 1ms before preemption, so remaining = 9 not 8. Let''s redo:
t=0 to t=1: P1 runs 1ms → remaining = 9
t=1 to t=2: P1 runs 1ms → remaining = 8
t=2: P3 arrives with burst=6 < P1 remaining=8 → P3 preempts.
t=2 to t=8: P3 runs → P3 completes at t=8. TAT(P3) = 8−2 = 6.
t=8: P4 arrives (burst=9). Ready: P1(rem=8), P2(rem=13), P4(9). Shortest = P1(8) → P1 runs.
t=8 to t=16: P1 runs → P1 completes at t=16... hmm but P4(9) and P1(8). P1 shorter → P1 runs till t=16. TAT(P1) = 16−0 = 16.
Wait — per the official Gantt chart on the page: P1(0-1), P3(1-8)... that means P3 preempts at t=1? But P3 arrives at t=2. The page shows P3(1-2) which is incorrect per arrival time. Using the correct data:
Correct Gantt: P1(0-2), P3(2-8), P1(8-16), P4(16-25), P2(25-38)... but that gives avg = (16+37+6+17)/4 = 76/4 = 19. ✓
Turnaround times:
P1: 16 − 0 = 16
P2: 38 − 1 = 37
P3: 8 − 2 = 6
P4: 25 − 8 = 17
Average = (16 + 37 + 6 + 17) / 4 = 76 / 4 = 19 ms
Similar Questions
Total Unique Visitors