Round Robin Scheduling Analysis for Five Processes with Time Quantum 3 ms
Round Robin CPU scheduling is designed for fairness: each ready process receives at most one time quantum per turn before the scheduler rotates to the next ready task.2 For standard performance analysis, we use:
These formulas are widely used in operating-systems scheduling analysis.2
We are given the following processes and a quantum of :
| Process | Arrival Time (AT) | CPU Burst Time (BT) |
|---|---|---|
| P1 | 0 | 12 |
| P2 | 0 | 10 |
| P3 | 1 | 4 |
| P4 | 4 | 10 |
| P5 | 2 | 12 |
A careful ready queue simulation is necessary because new arrivals during a quantum are appended to the queue, and unfinished processes are re-enqueued after their slice expires.2
Footnotes
-
Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩ ↩2 ↩3
-
Relative Time Quantum-based Enhancements in Round Robin Scheduling - Discusses RR scheduling and key evaluation metrics such as waiting time and turnaround time. ↩
-
What is Burst time, Arrival time, Exit time, Response time, Waiting time, Turnaround time, and Throughput? - AfterAcademy - Gives standard definitions of waiting time and turnaround time. ↩
-
Round Robin Scheduling with different arrival times - Tutorialspoint - Illustrates queue updates and RR execution when processes arrive at different times. ↩
Round Robin Scheduling - Solved Problem
Key Scheduling Rule Used
When a process uses its full quantum and is not finished, it is moved to the end of the ready queue. Processes arriving during that interval are inserted into the queue as they arrive.2
Footnotes
-
Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩
-
Round Robin Scheduling with different arrival times - Tutorialspoint - Illustrates queue updates and RR execution when processes arrive at different times. ↩
Round Robin Execution Walkthrough
- 1Step 1
At , both P1 and P2 have arrived, so the initial ready queue is . The scheduler selects the front process first.
Footnotes
-
Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩
-
- 2Step 2
P1 runs for one full quantum, reducing its remaining burst from to . During this interval, P3 arrives at and P5 arrives at . After P1 is preempted, it is appended to the rear. Queue becomes .2
Footnotes
-
Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩
-
Round Robin Scheduling with different arrival times - Tutorialspoint - Illustrates queue updates and RR execution when processes arrive at different times. ↩
-
- 3Step 3
P2 runs for , so its remaining burst becomes . During this interval, P4 arrives at . After preemption, queue becomes .2
Footnotes
-
Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩
-
Round Robin Scheduling with different arrival times - Tutorialspoint - Illustrates queue updates and RR execution when processes arrive at different times. ↩
-
- 4Step 4
P3 runs for and has remaining. It is re-enqueued. Queue becomes .
- 5Step 5
P5 uses one quantum and its remaining burst decreases from to . Queue becomes .
- 6Step 6
P1 runs again for , reducing its remaining burst from to . Queue becomes .
- 7Step 7
P4 runs for and its remaining burst becomes . Queue becomes .
- 8Step 8
P2 runs for another quantum and its remaining burst becomes . Queue becomes .
- 9Step 9
P3 needs only more, so it finishes at . Queue becomes .
- 10Step 10
P5 runs for and its remaining burst becomes . Queue becomes .
- 11Step 11
P1 runs for and its remaining burst becomes . Queue becomes .
- 12Step 12
P4 runs for and its remaining burst becomes . Queue becomes .
- 13Step 13
P2 runs for and its remaining burst becomes . Queue becomes .
- 14Step 14
P5 runs for and its remaining burst becomes . Queue becomes .
- 15Step 15
P1 uses its last and completes at . Queue becomes .
- 16Step 16
P4 runs for and its remaining burst becomes . Queue becomes .
- 17Step 17
P2 finishes its final at . Queue becomes .
- 18Step 18
P5 uses its final and completes at . Queue becomes .
- 19Step 19
P4 finishes its last at . All processes are complete.
The resulting Gantt chart is:
For clarity, the same schedule can be written linearly as:
| Interval | Running Process |
|---|---|
| P1 | |
| P2 | |
| P3 | |
| P5 | |
| P1 | |
| P4 | |
| P2 | |
| P3 | |
| P5 | |
| P1 | |
| P4 | |
| P2 | |
| P5 | |
| P1 | |
| P4 | |
| P2 | |
| P5 | |
| P4 |
This schedule follows the standard RR rule that each ready process receives up to one quantum in FIFO queue order before the next cycle begins.2
Footnotes
-
Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩
-
Round Robin Scheduling with different arrival times - Tutorialspoint - Illustrates queue updates and RR execution when processes arrive at different times. ↩
Fast Way to Compute Waiting Time
In RR problems, first compute each completion time from the Gantt chart. Then use and instead of summing many scattered waiting intervals.2
Footnotes
-
Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩
-
What is Burst time, Arrival time, Exit time, Response time, Waiting time, Turnaround time, and Throughput? - AfterAcademy - Gives standard definitions of waiting time and turnaround time. ↩
From the Gantt chart, the completion time values are:
- P1 completes at
- P2 completes at
- P3 completes at
- P4 completes at
- P5 completes at
Now compute turnaround time and waiting time:
| Process | AT | BT | CT | TAT | WT |
|---|---|---|---|---|---|
| P1 | 0 | 12 | 40 | ||
| P2 | 0 | 10 | 44 | ||
| P3 | 1 | 4 | 22 | ||
| P4 | 4 | 10 | 48 | ||
| P5 | 2 | 12 | 47 |
Therefore,
So the final answers are:
- Average waiting time =
- Average turn-around time =
These metrics match the standard operating-systems definitions for RR scheduling analysis.2
Footnotes
-
Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩
-
What is Burst time, Arrival time, Exit time, Response time, Waiting time, Turnaround time, and Throughput? - AfterAcademy - Gives standard definitions of waiting time and turnaround time. ↩
Waiting Time and Turnaround Time by Process
Comparison of per-process scheduling metrics under RR with quantum
Round Robin Scheduling Roadmap for This Problem
List arrivals and bursts
Phase 1Record each process with its arrival time and CPU burst so the ready queue can be simulated correctly."
Apply the $3 \text{ ms}$ quantum
Phase 2Run each selected process for at most ; if unfinished, append it to the rear of the ready queue."
Build the Gantt chart
Phase 3Track every CPU interval from until all remaining burst times become ."
Extract completion times
Phase 4Read the finishing instant for each process directly from the final Gantt chart."
Compute TAT and WT
Phase 5Use and , then average the results."
Common Doubts and Edge Cases
Gantt chart: – P1, – P2, – P3, – P5, – P1, – P4, – P2, – P3, – P5, – P1, – P4, – P2, – P5, – P1, – P4, – P2, – P5, – P4. Average waiting time , average turn-around time .
Knowledge Check
In Round Robin scheduling, what happens when a process uses its full quantum and still has remaining burst time?
Explore Related Topics
Memory Allocation with First-Fit and Best-Fit
Process Life Cycle States and Transition Diagram in Operating Systems
The process life‑cycle in an operating system is modeled by a five‑state diagram (New, Ready, Running, Waiting/Blocked, Terminated) that shows how specific events move a process between states, with optional suspended states for swapped‑out processes.
- Transitions are triggered by admission, dispatch, preemption, I/O wait, event completion, or exit.
- A running process may return to Ready (preemption) or go to Waiting (I/O), and after an event it moves back to Ready before Running again.
- Only one process can be Running on a single‑core CPU, while many can be Ready or Waiting.
- Extended models add Ready Suspend and Blocked Suspend to represent swapping.
- A typical life‑cycle can be expressed as .
FIFO Branch-and-Bound Uses a Queue
FIFO Branch-and-Bound expands live nodes in the exact order they are generated, so it is implemented with a queue.
- A queue enforces first‑in‑first‑out, giving the algorithm a BFS‑like, level‑order traversal.
- LIFO Branch‑and‑Bound uses a stack and least‑cost Branch‑and‑Bound uses a priority queue.
- Bounding prunes unpromising nodes independently of the FIFO selection rule.
- Pseudocode: initialize , enqueue root, while dequeue front, generate children, enqueue survivors.
- The abstract answer is “queue,” not an array or other structure, even if an array may implement a queue.