Skip to main content

Round robin scheduling (6, 4, 2 ms, q=2)

Short answer

Using round-robin quantum 2 ms, waiting times: P1 6, P2 6, P3 4 ms; average waiting time = 5.33 ms, average turnaround time = 9.33 ms.

Three processes with process IDs P1, P2, P3 with estimated completion time 6, 4, 2 ms respectively, enters the ready queue together in order P1, P2, P3. Calculate waiting time and TAT (Turn Around Time) for each process and average waiting time and TAT. Assume there is no I/O waiting for the processes and RR (Round-Robin) algorithm with time slice = 2 ms.

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

Gantt chart

| P1 | P2 | P3 | P1 | P2 | P1 |
0    2    4    6    8    10   12

Remaining time after each slice

  • 0-2 P1 (4 left), 2-4 P2 (2 left), 4-6 P3 (done)
  • 6-8 P1 (2 left), 8-10 P2 (done), 10-12 P1 (done)

Calculation

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

ProcessATBTCTTAT = CT - ATWT = TAT - BT
P10612126
P20410106
P302664

AWT = (6 + 6 + 4) / 3 = 16/3 = 5.33 ms

ATAT = (12 + 10 + 6) / 3 = 28/3 = 9.33 ms

Answer: AWT = 5.33 ms, ATAT = 9.33 ms.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Embedded System chapter 6 questions →