Question:

What is the average waiting time for the following CPU workload using Round Robin method with a time slice of 4 ms (assuming that all jobs arrived at the same time)?

Process No.Next CPU burst time in ms
A5
B7
C4
D9

Show Hint

Simulate 4 ms slices, find each finish time, then subtract each burst and average.
Updated On: Jul 2, 2026
  • 10.25 ms
  • 12.25 ms
  • 14.25 ms
  • 18.5 ms
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Step 1: All jobs arrive at time 0 in the order A, B, C, D. Bursts are A=5, B=7, C=4, D=9, and the time slice is 4 ms.

Step 2: Run the Round Robin schedule. Preempted jobs go to the back of the queue.
0 to 4: A runs, A left = 1.
4 to 8: B runs, B left = 3.
8 to 12: C runs, C left = 0, C finishes at 12.
12 to 16: D runs, D left = 5.
16 to 17: A runs 1 ms, A finishes at 17.
17 to 20: B runs 3 ms, B finishes at 20.
20 to 24: D runs 4 ms, D left = 1.
24 to 25: D runs 1 ms, D finishes at 25.

Step 3: Completion times: A = 17, B = 20, C = 12, D = 25. With arrival at 0, turnaround equals completion time.

Step 4: Waiting time = turnaround minus burst.
A: \(17 - 5 = 12\)
B: \(20 - 7 = 13\)
C: \(12 - 4 = 8\)
D: \(25 - 9 = 16\)

Step 5: Average waiting time:
\[\frac{12 + 13 + 8 + 16}{4} = \frac{49}{4} = 12.25 \text{ ms}\]
So the answer is (B) 12.25 ms.
Was this answer helpful?
0
0