Skip to main content

Round robin scheduling (9, 6, 3 ms, q=3)

Short answer

With round-robin time slice 3 ms, waiting times are P1 9, P2 9, P3 6 ms; average waiting time = 8 ms, average turnaround time = 14 ms.

Consider three processes with process IDs P1, P2, P3 with estimated completion time 9, 6, 3 milliseconds respectively, enter the ready queue in the order P1, P2, P3. Calculate the waiting time and Turn Around Time (TAT) for each process and also calculate the average waiting time and average TAT in Round Robin algorithm with time slice = 3ms. Assume there is no I/O waiting for the processes.

Round robin with a time slice of 3 ms; all processes arrive at 0 in the order P1, P2, P3.

Gantt chart

| P1 | P2 | P3 | P1 | P2 | P1 |
0    3    6    9    12   15   18

Remaining time after each slice

  • 0-3 P1 (6 left), 3-6 P2 (3 left), 6-9 P3 (done)
  • 9-12 P1 (3 left), 12-15 P2 (done), 15-18 P1 (done)

Calculation

TAT = completion time - arrival time; WT = TAT - burst time.

ProcessATBTCTTAT = CT - ATWT = TAT - BT
P10918189
P20615159
P303996

AWT = (9 + 9 + 6) / 3 = 24/3 = 8 ms

ATAT = (18 + 15 + 9) / 3 = 42/3 = 14 ms

Answer: AWT = 8 ms, ATAT = 14 ms.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Embedded System chapter 6 questions →