- Asked 4/19
- 2073 Magh · 4 marks
Round robin scheduling (9, 6, 3 ms, q=2)
Short answer
Round-robin with time slice 2 ms yields waiting times: P1 9, P2 9, P3 8 ms; average waiting time = 8.67 ms, average turnaround time = 14.67 ms.
Consider three processes with process IDs P1, P2, P3 with estimated completion time 9, 6, 3 ms respectively, enters the ready queue together in order P1, P2, P3. Calculate Waiting Time and Turn Around Time for each process and average waiting time and average turn around time in RR (Round-Robin) algorithm with time slice 2 ms. Assume there is no I/O waiting for the process.
Round robin gives each process the CPU for at most one time slice (2 ms), then moves it to the back of the ready queue. All processes arrive at 0 in the order P1, P2, P3.
Gantt chart
| P1 | P2 | P3 | P1 | P2 | P3 | P1 | P2 | P1 | P1 |
0 2 4 6 8 10 11 13 15 17 18
Remaining time after each slice
- 0-2 P1 (7 left), 2-4 P2 (4 left), 4-6 P3 (1 left)
- 6-8 P1 (5), 8-10 P2 (2), 10-11 P3 (done)
- 11-13 P1 (3), 13-15 P2 (done), 15-17 P1 (1), 17-18 P1 (done)
Calculation
TAT = completion time - arrival time; WT = TAT - burst time.
| Process | AT | BT | CT | TAT = CT - AT | WT = TAT - BT |
|---|---|---|---|---|---|
| P1 | 0 | 9 | 18 | 18 | 9 |
| P2 | 0 | 6 | 15 | 15 | 9 |
| P3 | 0 | 3 | 11 | 11 | 8 |
AWT = (9 + 9 + 8) / 3 = 26/3 = 8.67 ms
ATAT = (18 + 15 + 11) / 3 = 44/3 = 14.67 ms
Answer: AWT = 8.67 ms, ATAT = 14.67 ms.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Round robin scheduling (53, 17, 68, 24 ms) · Embedded System, chapter 6 · asked 4×
- Round robin scheduling (6, 4, 2 ms, q=2) · Embedded System, chapter 6 · asked 4×
- Round robin scheduling (9, 6, 3 ms, q=3) · Embedded System, chapter 6 · asked 4×
- Round robin scheduling (5, 8, 7 ms, q=2) · Embedded System, chapter 6
- Preemptive priority scheduling with P4 (6 ms) · Embedded System, chapter 6 · asked 2×
- Non-preemptive priority scheduling (10, 5, 7 ms) · Embedded System, chapter 6 · asked 2×
- Priority scheduling (7, 8, 5 ms) with P4 · Embedded System, chapter 6 · asked 2×
- Preemptive SJF/SRT scheduling (10, 5, 7 ms) · Embedded System, chapter 6
- Preemptive priority scheduling (4, 6, 5 ms) · Embedded System, chapter 6