Round Robin Concept
Round Robin Concept
Concept
BY: JONNIFER C MANDIGMA
SUBJECT PROFESSOR
What is Round Robin
• is a method used by operating systems
to manage the execution time of
multiple processes that are competing
for CPU attention. It is called "round
robin" because the system rotates
through all the processes, allocating
each of them a fixed time slice or
"quantum", regardless of their priority.
The primary goal of this scheduling method is to ensure that
all processes are given an equal opportunity to execute,
promoting fairness among tasks.
• Execution: The process uses the CPU for the allocated time.
• Rotation: If the process completes within the time, it leaves the system.
If not, it goes back to the end of the queue.
• Repeat: The CPU continues to cycle through the queue until all
processes are completed.
Characteristics of SJF Scheduling
How Does It Work? -
• Imagine you're at a busy restaurant with a group of
friends, and there's only one waiter. The waiter
could spend a long time at one table, but instead,
he choose to spend exactly one minute at each
table before moving to the next. Similarly, in Round
Robin Scheduling, the CPU spends a predetermined
slice of time on each process. If a process hasn't
finished its task by the time its slice is up, it's
moved to the back of the queue, and the CPU
moves on to the next process.
Advantages of Round Robin Scheduling
P1 4 ms 0 ms
P2 5 ms 0 ms
P3 3 ms 0 ms
• Step-by-Step Execution:
1.Time 0-2 (P1): P1 runs for 2 ms (total time left: 2 ms).
5.Time 8-10 (P2): P2 runs for another 2 ms (total time left: 1 ms).
P1 17 17 10
P2 13 13 9
P3 20 20 11
EXAMPLE 2
P1 4
P2 3
P3 5
Step 1) The execution begins with process P1, which has burst time 4. Here, every process
executes for 2 seconds. P2 and P3 are still in the waiting queue.
Step 2) At time =2, P1 is added to the end of the Queue and P2 starts executing
Step 3) At time=4 , P2 is preempted and add at the end of the queue. P3 starts executing.
Step 4) At time=6 , P3 is preempted and add at the end of the queue. P1 starts executing.
Step 5) At time=8 , P1 has a burst time of 4. It has completed execution. P2 starts execution
Step 6) P2 has a burst time of 3. It has already executed for 2 interval. At time=9, P2
completes execution. Then, P3 starts execution till it completes.
Step 7) Let’s calculate the average waiting time for
above example.
Wait time
P1= 0+ 4= 4
P2= 2+4= 6
P3= 4+3= 7