Round Robin Scheduling Analysis for Five Processes with Time Quantum 3 ms

Round Robin Scheduling Analysis for Five Processes with Time Quantum 3 ms

Verified Sources
May 27, 2026

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:

Turnaround Time (TAT)=Completion Time (CT)−Arrival Time (AT)\text{Turnaround Time (TAT)} = \text{Completion Time (CT)} - \text{Arrival Time (AT)}

Waiting Time (WT)=Turnaround Time (TAT)−Burst Time (BT)\text{Waiting Time (WT)} = \text{Turnaround Time (TAT)} - \text{Burst Time (BT)}

These formulas are widely used in operating-systems scheduling analysis.2

We are given the following processes and a quantum of 3 ms3 \text{ ms}:

ProcessArrival Time (AT)CPU Burst Time (BT)
P1012
P2010
P314
P4410
P5212

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

  1. Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩ ↩2 ↩3

  2. Relative Time Quantum-based Enhancements in Round Robin Scheduling - Discusses RR scheduling and key evaluation metrics such as waiting time and turnaround time. ↩

  3. 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. ↩

  4. 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 3 ms3 \text{ ms} 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

  1. Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩

  2. Round Robin Scheduling with different arrival times - Tutorialspoint - Illustrates queue updates and RR execution when processes arrive at different times. ↩

Round Robin Execution Walkthrough

  1. 1
    Step 1

    At t=0t=0, both P1 and P2 have arrived, so the initial ready queue is [P1,P2][P1, P2]. The scheduler selects the front process first.

    Footnotes

    1. Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩

  2. 2
    Step 2

    P1 runs for one full quantum, reducing its remaining burst from 1212 to 99. During this interval, P3 arrives at t=1t=1 and P5 arrives at t=2t=2. After P1 is preempted, it is appended to the rear. Queue becomes [P2,P3,P5,P1][P2, P3, P5, P1].2

    Footnotes

    1. Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩

    2. Round Robin Scheduling with different arrival times - Tutorialspoint - Illustrates queue updates and RR execution when processes arrive at different times. ↩

  3. 3
    Step 3

    P2 runs for 3 ms3 \text{ ms}, so its remaining burst becomes 77. During this interval, P4 arrives at t=4t=4. After preemption, queue becomes [P3,P5,P1,P4,P2][P3, P5, P1, P4, P2].2

    Footnotes

    1. Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩

    2. Round Robin Scheduling with different arrival times - Tutorialspoint - Illustrates queue updates and RR execution when processes arrive at different times. ↩

  4. 4
    Step 4

    P3 runs for 3 ms3 \text{ ms} and has 1 ms1 \text{ ms} remaining. It is re-enqueued. Queue becomes [P5,P1,P4,P2,P3][P5, P1, P4, P2, P3].

  5. 5
    Step 5

    P5 uses one quantum and its remaining burst decreases from 1212 to 99. Queue becomes [P1,P4,P2,P3,P5][P1, P4, P2, P3, P5].

  6. 6
    Step 6

    P1 runs again for 3 ms3 \text{ ms}, reducing its remaining burst from 99 to 66. Queue becomes [P4,P2,P3,P5,P1][P4, P2, P3, P5, P1].

  7. 7
    Step 7

    P4 runs for 3 ms3 \text{ ms} and its remaining burst becomes 77. Queue becomes [P2,P3,P5,P1,P4][P2, P3, P5, P1, P4].

  8. 8
    Step 8

    P2 runs for another quantum and its remaining burst becomes 44. Queue becomes [P3,P5,P1,P4,P2][P3, P5, P1, P4, P2].

  9. 9
    Step 9

    P3 needs only 1 ms1 \text{ ms} more, so it finishes at t=22t=22. Queue becomes [P5,P1,P4,P2][P5, P1, P4, P2].

  10. 10
    Step 10

    P5 runs for 3 ms3 \text{ ms} and its remaining burst becomes 66. Queue becomes [P1,P4,P2,P5][P1, P4, P2, P5].

  11. 11
    Step 11

    P1 runs for 3 ms3 \text{ ms} and its remaining burst becomes 33. Queue becomes [P4,P2,P5,P1][P4, P2, P5, P1].

  12. 12
    Step 12

    P4 runs for 3 ms3 \text{ ms} and its remaining burst becomes 44. Queue becomes [P2,P5,P1,P4][P2, P5, P1, P4].

  13. 13
    Step 13

    P2 runs for 3 ms3 \text{ ms} and its remaining burst becomes 11. Queue becomes [P5,P1,P4,P2][P5, P1, P4, P2].

  14. 14
    Step 14

    P5 runs for 3 ms3 \text{ ms} and its remaining burst becomes 33. Queue becomes [P1,P4,P2,P5][P1, P4, P2, P5].

  15. 15
    Step 15

    P1 uses its last 3 ms3 \text{ ms} and completes at t=40t=40. Queue becomes [P4,P2,P5][P4, P2, P5].

  16. 16
    Step 16

    P4 runs for 3 ms3 \text{ ms} and its remaining burst becomes 11. Queue becomes [P2,P5,P4][P2, P5, P4].

  17. 17
    Step 17

    P2 finishes its final 1 ms1 \text{ ms} at t=44t=44. Queue becomes [P5,P4][P5, P4].

  18. 18
    Step 18

    P5 uses its final 3 ms3 \text{ ms} and completes at t=47t=47. Queue becomes [P4][P4].

  19. 19
    Step 19

    P4 finishes its last 1 ms1 \text{ ms} at t=48t=48. All processes are complete.

The resulting Gantt chart is:

For clarity, the same schedule can be written linearly as:

IntervalRunning Process
0−30-3P1
3−63-6P2
6−96-9P3
9−129-12P5
12−1512-15P1
15−1815-18P4
18−2118-21P2
21−2221-22P3
22−2522-25P5
25−2825-28P1
28−3128-31P4
31−3431-34P2
34−3734-37P5
37−4037-40P1
40−4340-43P4
43−4443-44P2
44−4744-47P5
47−4847-48P4

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

  1. Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩

  2. 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 TAT=CT−AT\text{TAT} = \text{CT} - \text{AT} and WT=TAT−BT\text{WT} = \text{TAT} - \text{BT} instead of summing many scattered waiting intervals.2

Footnotes

  1. Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩

  2. 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 4040
  • P2 completes at 4444
  • P3 completes at 2222
  • P4 completes at 4848
  • P5 completes at 4747

Now compute turnaround time and waiting time:

ProcessATBTCTTAT =CT−AT=CT-ATWT =TAT−BT=TAT-BT
P10124040−0=4040-0=4040−12=2840-12=28
P20104444−0=4444-0=4444−10=3444-10=34
P3142222−1=2122-1=2121−4=1721-4=17
P44104848−4=4448-4=4444−10=3444-10=34
P52124747−2=4547-2=4545−12=3345-12=33

Therefore,

Average Waiting Time=28+34+17+34+335=1465=29.2 ms\text{Average Waiting Time} = \frac{28+34+17+34+33}{5} = \frac{146}{5} = 29.2 \text{ ms}

Average Turnaround Time=40+44+21+44+455=1945=38.8 ms\text{Average Turnaround Time} = \frac{40+44+21+44+45}{5} = \frac{194}{5} = 38.8 \text{ ms}

So the final answers are:

  • Average waiting time = 29.2 ms29.2 \text{ ms}
  • Average turn-around time = 38.8 ms38.8 \text{ ms}

These metrics match the standard operating-systems definitions for RR scheduling analysis.2

Footnotes

  1. Round Robin Scheduling in Operating System - GeeksforGeeks - Defines RR behavior, formulas for turnaround and waiting time, and solved examples. ↩

  2. 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 3 ms3 \text{ ms}

Round Robin Scheduling Roadmap for This Problem

List arrivals and bursts

Phase 1

Record each process with its arrival time and CPU burst so the ready queue can be simulated correctly."

Apply the $3 \text{ ms}$ quantum

Phase 2

Run each selected process for at most 3 ms3 \text{ ms}; if unfinished, append it to the rear of the ready queue."

Build the Gantt chart

Phase 3

Track every CPU interval from t=0t=0 until all remaining burst times become 00."

Extract completion times

Phase 4

Read the finishing instant for each process directly from the final Gantt chart."

Compute TAT and WT

Phase 5

Use TAT=CT−AT\text{TAT}=\text{CT}-\text{AT} and WT=TAT−BT\text{WT}=\text{TAT}-\text{BT}, then average the results."

Common Doubts and Edge Cases

Gantt chart: 00–33 P1, 33–66 P2, 66–99 P3, 99–1212 P5, 1212–1515 P1, 1515–1818 P4, 1818–2121 P2, 2121–2222 P3, 2222–2525 P5, 2525–2828 P1, 2828–3131 P4, 3131–3434 P2, 3434–3737 P5, 3737–4040 P1, 4040–4343 P4, 4343–4444 P2, 4444–4747 P5, 4747–4848 P4. Average waiting time =29.2 ms=29.2 \text{ ms}, average turn-around time =38.8 ms=38.8 \text{ ms}.

Knowledge Check

Question 1 of 5
Q1Single choice

In Round Robin scheduling, what happens when a process uses its full quantum and still has remaining burst time?