- 2075 Bhadra · 6 marks
Round robin scheduling (5, 8, 7 ms, q=2)
Short answer
Round-robin with time slice 2 ms gives waiting times: P1 8, P2 11, P3 13 ms; average waiting time = 10.67 ms, average turnaround time = 17.33 ms.
Three Processes P1, P2 and P3 with estimated completion time 5, 8, 7 ms respectively enters the ready queue together. Calculate WT, TAT for each process and calculate AWT and ATAT using Round Robin Pre-emptive scheduling algorithms with time slice of 2 ms.
Round robin (pre-emptive) 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 | P3 | P1 | P2 | P3 | P2 | P3 |
0 2 4 6 8 10 12 13 15 17 19 20
Remaining time after each slice
- Round 1: P1 0-2 (3 left), P2 2-4 (6 left), P3 4-6 (5 left)
- Round 2: P1 6-8 (1 left), P2 8-10 (4 left), P3 10-12 (3 left)
- Round 3: P1 12-13 (done), P2 13-15 (2 left), P3 15-17 (1 left)
- Round 4: P2 17-19 (done), P3 19-20 (done)
Calculation
TAT = completion time - arrival time; WT = TAT - burst time.
| Process | AT | BT | CT | TAT = CT - AT | WT = TAT - BT |
|---|---|---|---|---|---|
| P1 | 0 | 5 | 13 | 13 | 8 |
| P2 | 0 | 8 | 19 | 19 | 11 |
| P3 | 0 | 7 | 20 | 20 | 13 |
AWT = (8 + 11 + 13) / 3 = 32/3 = 10.67 ms
ATAT = (13 + 19 + 20) / 3 = 52/3 = 17.33 ms
Answer: AWT = 10.67 ms, ATAT = 17.33 ms.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Round robin scheduling (6, 4, 2 ms, q=2) · Embedded System, chapter 6 · asked 4×
- Round robin scheduling (9, 6, 3 ms, q=2) · Embedded System, chapter 6 · asked 4×
- Round robin scheduling (53, 17, 68, 24 ms) · Embedded System, chapter 6 · asked 4×
- Round robin scheduling (9, 6, 3 ms, q=3) · Embedded System, chapter 6 · asked 4×
- Preemptive priority scheduling (4, 10, 5 ms) · Embedded System, chapter 6 · asked 2×
- Priority and SJF scheduling with P4 and P5 · Embedded System, chapter 6 · asked 2×
- Real-time scheduling; two-processor numerical · Operating System, chapter 2
- Context switching, 5-state model, MLFQ · Operating System, chapter 2