---
title: "CPU criteria; RR Gantt and times"
subject: "Operating System"
chapter: 2
key: "semester_6/operating_system:cpu-criteria-rr-gantt"
source: https://www.bctengineer.com/q/semester_6/operating_system/cpu-criteria-rr-gantt
site: BCT Engineering
---

# CPU criteria; RR Gantt and times

Operating System · Chapter 2: Process Management

- Asked in: 2068 Magh, 2+6 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/cpu-criteria-rr-gantt
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-2

## Question

What are the performance criteria for CPU? Assume you have the following jobs to execute with one processor.
| Job | Burst Time | Arrival Time |
|---|---|---|
| 0 | 75 | 0 |
| 1 | 50 | 10 |
| 2 | 25 | 10 |
| 3 | 20 | 80 |
| 4 | 45 | 85 |
Suppose a system uses round-robin scheduling with quantum of 15 sec.
a) Draw the Gantt chart
b) Find the average wait and turnaround time

## Short answer

Performance criteria: CPU utilization, throughput, turnaround, waiting, response time. With RR q=15, Gantt: J0 0-15, J1 15-30, J2 30-45, J0 45-60, J1 60-75, J2 75-85, J0 85-100, J1 100-115, J3 115-130, J4 130-145, J0 145-160, J1 160-165, J3 165-170, J4 170-185, J0 185-200, J4 200-215. Average waiting time 87, average turnaround time 130 (time units).

## Answer

#### Performance criteria for CPU scheduling

1. **CPU utilization**: keep the CPU as busy as possible (about 40% to 90% in real systems).
2. **Throughput**: number of processes completed per unit time.
3. **Turnaround time**: time from submission to completion (waiting + running + I/O).
4. **Waiting time**: total time spent waiting in the ready queue.
5. **Response time**: time from submission until the first response is produced (important in interactive systems).
6. **Fairness** and **deadlines met** (real-time) are further criteria.

We want to maximise CPU utilization and throughput, and minimise turnaround, waiting and response times.

#### Round robin, quantum = 15

Assumption: a newly arriving process enters the ready queue before a process whose quantum has just expired. At t = 10, J1 and J2 arrive together (J1 first). The CPU is never idle, because some job is always ready, so the schedule ends at the total burst time of 215.

**a) Gantt chart**

```text
| J0 | J1 | J2 | J0 | J1 | J2 | J0 | J1 | J3 | J4 |
0    15   30   45   60   75   85   100  115  130  145
| J0 | J1 | J3 | J4 | J0 | J4 |
145  160  165  170  185  200  215
```

**b) Times** (Turnaround = Completion − Arrival, Waiting = Turnaround − Burst)

| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| J0 | 0 | 75 | 200 | 200 | 125 |
| J1 | 10 | 50 | 165 | 155 | 105 |
| J2 | 10 | 25 | 85 | 75 | 50 |
| J3 | 80 | 20 | 170 | 90 | 70 |
| J4 | 85 | 45 | 215 | 130 | 85 |

Average waiting time = 435 / 5 = **87**

Average turnaround time = 650 / 5 = **130**

**Answer: average waiting time = 87 and average turnaround time = 130 (time units).**

## Check yourself

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

1. Which set correctly states what a CPU scheduler tries to maximise and minimise?
   A. Maximise waiting and response time; minimise throughput
   B. Maximise CPU utilization and throughput; minimise turnaround, waiting and response time
   C. Maximise turnaround time; minimise CPU utilization
   D. Maximise response time and fairness; minimise throughput
   Answer: B. We want the CPU busy and many jobs finished per unit time, while keeping turnaround, waiting and response times as small as possible. (Key point: Scheduling criteria goals)

2. What does waiting time measure?
   A. Total time from submission to completion
   B. Time from submission until the first response
   C. Total time spent waiting in the ready queue
   D. Number of processes completed per unit time
   Answer: C. Waiting time is the sum of the periods a process sits in the ready queue; the other options describe turnaround, response time and throughput. (Key point: Waiting time definition)

3. In the round-robin solution, what happens when a new process arrives at the same moment another process's quantum expires?
   A. The preempted process goes to the queue first
   B. The new arrival enters the ready queue before the preempted process
   C. The new arrival is discarded until the next quantum
   D. The CPU stays idle for one quantum
   Answer: B. The stated assumption is that a newly arriving process is queued ahead of the process whose quantum has just expired. (Key point: RR queue-order assumption)

4. With turnaround = completion - arrival and waiting = turnaround - burst, what are the averages found for the five jobs?
   A. Waiting 130, turnaround 87
   B. Waiting 87, turnaround 130
   C. Waiting 125, turnaround 200
   D. Waiting 435, turnaround 650
   Answer: B. Total waiting 435 and total turnaround 650 divided by 5 jobs give 87 and 130. (Key point: Average waiting and turnaround results)

## Related in Operating System

- [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, 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
- [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
- [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
- [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
- [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

## Related in other subjects

- [AVL tree for 10 20 30 50 45 40 8 5 3](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Aavl-build-10-20-30) — Data Structure and Algorithm, chapter 6
- [Bezier points at u=0.25,0.5,0.75: (10,15)...](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Abezier-points-control-10-15) — Computer Graphics, chapter 5, asked 4×
- [Bezier points at u=0.25,0.5,0.75: (2,10)...](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Abezier-points-control-2-10) — Computer Graphics, chapter 5, asked 2×
- [Bezier points at u=0.25,0.5,0.75: (10,10)...](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Abezier-points-control-10-10) — Computer Graphics, chapter 5, asked 2×
