---
title: "Round robin scheduling (5, 8, 7 ms, q=2)"
subject: "Embedded System"
chapter: 6
key: "semester_6/embedded_system:sched-rr-5-8-7-q2"
source: https://www.bctengineer.com/q/semester_6/embedded_system/sched-rr-5-8-7-q2
site: BCT Engineering
---

# Round robin scheduling (5, 8, 7 ms, q=2)

Embedded System · Chapter 6: RTOS

- Asked in: 2075 Bhadra, 6 marks
- Video: [Round Robin Scheduling Algorithm| Preemptive | Operating System  | OS](https://www.youtube.com/watch?v=j5Rt_at1oyk) — Sudhakar Atchala
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/embedded_system/sched-rr-5-8-7-q2
- Whole chapter: https://www.bctengineer.com/md/semester_6/embedded_system/chapter-6

## Question

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.

## 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.

## Answer

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

#### Gantt chart

```text
| 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.**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. When does P1 finish?
   A. 8 ms
   B. 12 ms
   C. 13 ms
   D. 5 ms
   Answer: C. Its last slice is 1 ms, 12-13. (Key point: P1 completion)

2. Who finishes last?
   A. P2 at 20 ms
   B. P3 at 20 ms
   C. P1 at 20 ms
   D. P3 at 19 ms
   Answer: B. P3 has remaining 1 ms after P2 finishes at 19. (Key point: Last process)

3. P2's waiting time?
   A. 11 ms
   B. 19 ms
   C. 8 ms
   D. 13 ms
   Answer: A. TAT = 19, WT = 19 - 8 = 11. (Key point: P2 waiting)

4. AWT and ATAT?
   A. 17.33 ms and 10.67 ms
   B. 11 ms and 18 ms
   C. 32 ms and 52 ms
   D. 10.67 ms and 17.33 ms
   Answer: D. AWT = 32/3; ATAT = 52/3. (Key point: Averages)

## Related in Embedded System

- [Round robin scheduling (6, 4, 2 ms, q=2)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-rr-6-4-2-q2) — Embedded System, chapter 6, asked 4×
- [Round robin scheduling (9, 6, 3 ms, q=2)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-rr-9-6-3-q2) — Embedded System, chapter 6, asked 4×
- [Round robin scheduling (53, 17, 68, 24 ms)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-rr-53-17-68-24-q4) — Embedded System, chapter 6, asked 4×
- [Round robin scheduling (9, 6, 3 ms, q=3)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-rr-9-6-3-q3) — Embedded System, chapter 6, asked 4×
- [Preemptive priority scheduling (4, 10, 5 ms)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-priority-4-10-5-p4) — Embedded System, chapter 6, asked 2×
- [Priority and SJF scheduling with P4 and P5](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-priority-and-sjf-5-process) — Embedded System, chapter 6, asked 2×

## Related in other subjects

- [Real-time scheduling; two-processor numerical](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Arealtime-two-processor-fcfs-sjf-priority-rr) — Operating System, chapter 2
- [Context switching, 5-state model, MLFQ](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Acontext-switch-5state-mlfq) — Operating System, chapter 2
