A PRIORITY BASED ROUND ROBIN
CPU SCHEDULING ALGORITHM FOR
REAL TIME SYSTEMS
Submitted to:
Ms. Meenakshi Srivastava
Submitted by:
Aayush Singh 2K20/IT/03
Abhinav Tripathi 2K20/IT/05
Abstract
The main objective is to develop a new approach for Round Robin CPU scheduling algorithm
which improves the performance of CPU in real time operating system.
The proposed Priority based Round-Robin CPU Scheduling algorithm is based on the
integration of Round Robin and Priority Scheduling algorithm. It retains the advantage of
Round Robin in reducing starvation and also integrates the advantage of priority scheduling.
The proposed algorithm also implements the concept of aging by assigning new priorities to
the processes.
The proposed algorithm improves all the drawbacks of Round Robin CPU scheduling
algorithm.
We have also done a comparative analysis of proposed algorithm with existing Round Robin
scheduling algorithm on the basis of varying time quantum, average waiting time, average
turnaround time and number of context switches.
Introduction
Scheduling is the process by which processes are given access to system resources. CPU
scheduling plays an important role in the real-time operating system which always has a
time constraint on computations.
A real-time system is one whose applications are mission-critical, where real-time tasks
should be scheduled to be completed before their deadlines. In Real-time systems, each
task should be invoked after the ready time and must be completed before its deadline.
Simple round robin architecture is not suitable to implement in Soft real-time systems
due to more number of context switches, and longer waiting and response times. This in
turn leads to low throughput in the system. If a real-time process has a relatively larger
CPU burst it will lead to the problem of starvation.
Priority scheduling may be a better option for real-time scheduling but it will face a similar
problem i.e. low priority processes will always be starved.
Scheduling Objectives
There are a variety of factors that must be considered while designing a scheduling
algorithm:-
Maximize throughput
Avoid indefinite blocking or starvation
Minimize overhead
Enforcement of priorities
Achieve balance between response and utilization
Round Robin Algorithm
Round Robin is a CPU scheduling algorithm where each process is assigned a fixed time slot in a
cyclic way. It is simple, easy to implement, and starvation-free as all processes get fair share of
CPU.
There are some disadvantages of Round Robin CPU Scheduling Algorithm:
Larger waiting time and response time
High Context Switches
Low throughput
With these observations it was found that the existing simple round robin architecture is not
suitable for real time systems. So, its drawbacks are eliminated in the proposed modified version
of round robin.
Priority Scheduling Algorithm
Priority scheduling is a non-preemptive algorithm. Each process is assigned a priority. Process
with highest priority is to be executed first and so on. Processes with same priority are executed
on first come first served basis. The operating system assigns a fixed priority to every process,
and the scheduler arranges the processes in the ready queue in order of their priority.
Disadvantages:-
Starvation of lower priority processes is possible if large number of higher priority processes
keep arriving continuously.
Proposed Algorithm
The proposed architecture focuses on the drawbacks of simple round robin architecture which gives equal
priority to all the processes. The proposed architecture eliminates the defects of implementing simple round
robin architecture. The algorithm will be executed in two steps which will help to minimize a number of
performance parameters such as context switches, average waiting time and average turnaround time.
The algorithm performs the following steps:
Step 1: Allocate CPU to every process in round robin fashion, according to the given priority, for given time
quantum (say k units) only for one time.
Step 2: After completion of first step following steps are performed:
Processors are arranged in increasing order or their remaining CPU burst time in the ready queue. New
priorities are assigned according to the remaining CPU bursts of processes; the process with shortest
remaining CPU burst is assigned with highest priority.
The processes are executed according to the new priorities based on the remaining CPU bursts, and each
process gets the control of the CPU until they finish their execution.
Case Studies
Here we have considered a set of five processes A, B, C, D and E with given CPU burst time and
associated priorities.
Time quantum is 5 ms.
According to Simple RR Scheduling
Gantt Chart:-
Number of context switches = 13
Average waiting Time = 33.200001 ms
Average Turnaround Time = 45.8 ms
According to Proposed Algorithm
STEP-1 STEP-2
Gantt Chart:-
Number of context switches = 8
Average waiting Time = 26.200001 ms
Average Turnaround Time = 38.800000 ms
Output Screenshots
Output Screenshots
Comparison of Results
We have successfully compared both the algorithms i.e. simple
round robin and the proposed one and we conclude that the
proposed one is more efficient because it has less average waiting
time, average turnaround time and number of context switches as
Conclusion compared to simple round robin, in turn reducing the operating
system overhead and hence dispatch latency. Also, it reduces the
problem of starvation as the processes with less remaining CPU
burst time are assigned with the higher priorities and are
executed first in the second round of algorithm. Performance of
time sharing systems can be improved with the proposed
algorithm and can also be modified to enhance the performance
of real time system.
We've observed that there's always room for improvement. This
Future Work proposed priority-based round-robin algorithm can be
implemented in real-time systems, and more such algorithms and
systems can be developed to achieve incredibly rapid
performance. We anticipate further technological advancements
in the near future.
[Link]
[Link]/technical_references/pdfs/information_technology/A%
References
20Priority%[Link]
[Link]
eduling_algorithms.htm#:~:text=Priority%20scheduling%20is%20a%2
0non,first%20come%20first%20served%20basis.
[Link]
Thank-you!