0% found this document useful (0 votes)
8 views13 pages

Operating System[1]

The document discusses the Round Robin CPU scheduling algorithm, which allocates a fixed time quantum to each process to ensure fairness and responsiveness in a multiprogramming environment. It outlines the advantages and disadvantages of the algorithm, as well as key elements such as arrival time, burst time, and waiting time. The document also includes an example and a Gantt chart to illustrate the scheduling process.

Uploaded by

Kirti Ganashar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views13 pages

Operating System[1]

The document discusses the Round Robin CPU scheduling algorithm, which allocates a fixed time quantum to each process to ensure fairness and responsiveness in a multiprogramming environment. It outlines the advantages and disadvantages of the algorithm, as well as key elements such as arrival time, burst time, and waiting time. The document also includes an example and a Gantt chart to illustrate the scheduling process.

Uploaded by

Kirti Ganashar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

OPERATING SYSTEM

SUBMITTED TO DR. SURAJ ARYA

SUBMITTED BY DEBJYOTI MAHATO


DEPT. : CS & IT
PROGRAMME : MCA
ROLL NO. : 240493
Table of Contains :
01 INTRODUCTION & PURPOSES
02 KEY OBJECTIVE OF ROUND ROBIN
03 TIME QUANTUM IN ROUND ROBIN
04 ELEMENTS OF ROUND ROBIN
05 ADVANTAGE OF ROUND ROBIN
06 DISADVANTAGE OF ROUND ROBIN
07 ALGORITHM OF ROUND ROBIN
08 GANTT CHART
09 EXAMPLE
10 CONCLUSION
INTRODUCTION
• Round Robin is a CPU scheduling algorithm where each process is cyclically assigned a fixed time slot. This
algorithm generally focuses on Time Sharing technique.

• The period of time for which a process or job is allowed to run in a pre-emptive method is called
time quantum.

• Each process or job present in the ready queue is assigned the CPU for that time quantum, if the execution
of the process is completed during that time then the process will end else the process will go back to the waiting
table and wait for its next turn to complete the execution.

PURPOSES : The primary purpose of Round Robin scheduling is to provide fairness and
responsiveness in a multiprogramming environment. It ensures that each process gets a fair
share of CPU time, preventing any single process from monopolizing the system.
Key Objective Of Round Robin:
Fairness: Every process receives an equal time slice (time quantum) of CPU
time, ensuring that no process is starved or denied access to the CPU
indefinitely.

Responsiveness: Short processes are typically completed quickly, providing a


responsive user experience.

Time-sharing: Round Robin is well-suited for time-sharing systems where


multiple users share a single CPU. It allows each user to interact with their
applications without significant delays.
TIME QUANTUM IN ROUND ROBIN

• ROUND ROBIN CPU Sheduling algorithm generally focus on TIME Sharing technique.
The period of time for which a process or job is allowed to run in a pre-emptive method is called
time quantum.

• Each process or job present in the ready queue is assigned the CPU for that time quantum, if the
execution of the process is completed during that time then the process will end else the process will go
back to the waiting table and wait for its next turn to complete the execution.

Diagram of time quantam in


Round Robin
ELEMENTS OF ROUND ROBIN

1.AT - - - > Arrival Time


2.BT - - - > Burst Time
3.WT - - - > Waiting Time
4.TAT - - - > Turn Around Time
5.CT - - - > Completion Time

1 Arrival Time The moment when a process enters the ready queue and is eligible for execution
by the CPU.
2 Burst Time The amount of CPU time a process needs to finish its execution
3 Waiting Time Long burst time processes that execute before other processes can cause a long
wait time in the queue
4 Turn Around Time It’s indicates the time Difference between completion time and arrival time. The
Formula to calculate the same is: Turn Around Time = Completion Time – Arrival
Time.
5 Completion Time It’s the exact time when a process finishes the execution.
ADVANTAGE OF ROUND ROBIN
Advantage :
•No issues of starvation effect.
•Every job gets a fair allocation of CPU.
•No priority scheduling is involved.
•Doesn’t depend on burst time and is easily implementable.
•When a process executes for a specific time, it is preempted, and another process takes
its place executing for that same time period.
•Best performance in terms of average response time.
DISADVATAGE OF ROUND ROBIN
Disadvantage :
•SPEN DS MOR E TIME ON CONTEXT SWITCHIN G.
•PER FOR MAN CE DEPEN DS ON TIM E QUAN TUM.
•PROCESSES DON ’T HAVE PR IOR ITIES.
•N O SPECIAL PRIORITY TO MORE IMPORTAN T TASKS.
•HIGHER CON TEXT SWITCHIN G OVER HEAD DUE TO LOWER
TIME QUAN TUM.
•DIF F ICULT TO F IN D A COR R ECT TIM E QUAN TUM.
Algorithm for Round Robin
•Initialize ready queue: Create a queue to hold processes waiting for CPU time.

•Select first process: Choose the first process from the ready queue.

•Allocate time quantum: Assign a fixed time quantum to the selected process.

•Execute process: Let the process execute for the allocated time quantum.

•Check completion:
•If the process completes within the quantum, remove it from the ready queue and calculate its turnaround
time, waiting time, and response time.

•If the process doesn't complete within the quantum, preempt it and place it at the end of the ready queue.

•Select next process: Choose the next process from the ready queue and repeat steps 3-5.

•Repeat: Continue this process until all processes are finished.


Gantt Chart in Round Robin Scheduling
A Gantt chart is a visual representation of the scheduling of tasks over time. In
the context of Round Robin scheduling, it provides a graphical depiction of how
CPU time is allocated to different processes.
Example of Round Robin CPU Scheduling :
Process Arrival Time Burst Time
P1 0 8
P2 1 4
P3 2 2

For P1,P2,P3 process the time quantum is 2 units. Every process use the cpu for the 2 units of
time .

P1 P2 P3 P1 P2 P1 P1
GANTT CHART

•P1: Executes for 2 units.


•P2: Executes for 2 units.
•P3: Executes for 2 units.
•P1: Executes for 2 units.
•P2: Completes (remaining 2 units).
•P1: Executes for 2 units.
•P1: Completes (remaining 2 units).
CONCLUSION:

In conclusion, Round Robin CPU scheduling is a fair and preemptive algorithm that allocates a fixed
time quantum to each process, ensuring equal CPU access. It is simple to implement but can lead to
higher context-switching overhead. While it promotes fairness and prevents starvation, it may result
in longer waiting times and reduced throughput, depending on the time quantum. Effective
program implementation allows for the calculation of key metrics like completion time, turnaround
time, and waiting time, aiding in performance evaluation and optimization.
THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy