---
title: "Two processors: priority and RR (q=3)"
subject: "Operating System"
chapter: 2
key: "semester_6/operating_system:two-processor-priority-rr-q3"
source: https://www.bctengineer.com/q/semester_6/operating_system/two-processor-priority-rr-q3
site: BCT Engineering
---

# Two processors: priority and RR (q=3)

Operating System · Chapter 2: Process Management

- Asked in: 2073 Bhadra, 5+5 marks
- Video: [L-2.7: Round Robin(RR) CPU Scheduling Algorithm with  Example](https://www.youtube.com/watch?v=TxjIlNYRZ5M) — Gate Smashers
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/two-processor-priority-rr-q3
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-2

## Question

Assume the system having two processors of same configuration, schedule the following set of processes according to preemptive priority and round robin algorithm (Time quantum = 3) and calculate average waiting time and average turnaround time.
| Process | Arrive Time | CPU Time (ms) | priority |
|---|---|---|---|
| A | 0 | 12 | 1 |
| B | 2 | 8 | 2 |
| C | 5 | 7 | 4 |
| D | 3 | 9 | 3 |
| E | 4 | 6 | 2 |
| F | 8 | 5 | 1 |
| G | 7 | 7 | 3 |
| H | 3 | 4 | 4 |
| I | 4 | 2 | 3 |

## Short answer

With two processors sharing one ready queue, preemptive priority yields average waiting time10.56 ms, average turnaround time17.22 ms; round robin (q=3) gives average waiting time14.33 ms, average turnaround time21 ms.

## Answer

Assumptions: both processors are identical and share one ready queue; a process may run on either processor; priority 1 is the highest; ties are broken by earlier arrival; context-switch time is zero. In round robin a process arriving at the same instant a quantum ends joins the queue before the preempted one.

#### 1. Preemptive priority

At every instant the two highest-priority ready processes run on the two CPUs. A new process of higher priority preempts the lowest-priority running one. (A and F, both priority 1, hold the CPUs whenever present; F arrives at 8 and preempts B.)

```text
CPU1
| A | B | D | H | C |
0   12  14  23  27  34
CPU2
| idle | B | F | E | I | G |
0      2   8   13  19  21  28
```

| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| A | 0 | 12 | 12 | 12 | 0 |
| B | 2 | 8 | 14 | 12 | 4 |
| C | 5 | 7 | 34 | 29 | 22 |
| D | 3 | 9 | 23 | 20 | 11 |
| E | 4 | 6 | 19 | 15 | 9 |
| F | 8 | 5 | 13 | 5 | 0 |
| G | 7 | 7 | 28 | 21 | 14 |
| H | 3 | 4 | 27 | 24 | 20 |
| I | 4 | 2 | 21 | 17 | 15 |

Average waiting time = 95/9 = **10.56**; average turnaround time = 155/9 = **17.22**

#### 2. Round Robin (q = 3)

Both CPUs take processes from the head of a single FIFO queue; each runs at most 3 ms and then goes to the tail.

```text
CPU1
| A | D | A | I | C | D | F | E | B | G | A |
0   3   6   9   11  14  17  20  23  25  28  31
CPU2
| idle | B | H | E | B | G | H | A | C | D | F | C |
0      2   5   8   11  14  17  18  21  24  27  29  30
| G |
30  31
```

| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| A | 0 | 12 | 31 | 31 | 19 |
| B | 2 | 8 | 25 | 23 | 15 |
| C | 5 | 7 | 30 | 25 | 18 |
| D | 3 | 9 | 27 | 24 | 15 |
| E | 4 | 6 | 23 | 19 | 13 |
| F | 8 | 5 | 29 | 21 | 16 |
| G | 7 | 7 | 31 | 24 | 17 |
| H | 3 | 4 | 18 | 15 | 11 |
| I | 4 | 2 | 11 | 7 | 5 |

Average waiting time = 129/9 = **14.33**; average turnaround time = 189/9 = **21**

**Answer: Preemptive priority: AWT = 10.56 ms, ATAT = 17.22 ms. Round robin (q=3): AWT = 14.33 ms, ATAT = 21 ms.**

## Check yourself

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

1. What are the key assumptions for the two identical processors?
   A. Each CPU has a separate ready queue and processes cannot move
   B. Both share one ready queue and a process may run on either CPU
   C. Only one CPU runs at a time
   D. Context switch time is large
   Answer: B. A shared ready queue lets any free processor take the next process. (Key point: Two-processor assumptions)

2. Why does F (priority 1, arriving at 8) preempt B?
   A. F has the shortest burst
   B. With A and F being the highest priority, F must be on a CPU and B is the lowest-priority running process
   C. B finished already
   D. F arrived first
   Answer: B. A new higher-priority process preempts the lowest-priority one running on the two CPUs. (Key point: Preemption by F)

3. What are AWT and ATAT for preemptive priority on two CPUs?
   A. 14.33 and 21
   B. 10.56 and 17.22
   C. 95 and 155
   D. 12 and 20
   Answer: B. Total waiting 95 and turnaround 155 over 9 processes give 10.56 and 17.22; 14.33 and 21 belong to round robin. (Key point: Priority results)

## Related in Operating System

- [RR, preemptive priority, preemptive SJF](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aprocess-rr-priority-preemptive-sjf) — Operating System, chapter 2
- [FCFS, SJF, Priority, RR Gantt; max AWT](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Ascheduling-gantt-fcfs-sjf-priority-rr-q2) — Operating System, chapter 2
- [HRRN and RR scheduling (q=4)](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Ahrrn-rr-q4-awt-att) — Operating System, chapter 2
- [Preemptive priority and SRTF Gantt](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Apreemptive-priority-srtf-gantt) — Operating System, chapter 2
- [FCFS, SJF, RR Gantt and turnaround](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afcfs-sjf-rr-q5-timeline) — Operating System, chapter 2
- [Avg turnaround: FCFS, RR, SJF, SRT, HRRN](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aavg-turnaround-fcfs-rr-sjf-srt-hrrn) — Operating System, chapter 2

## Related in other subjects

- [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 (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=3)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-rr-9-6-3-q3) — 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×
