Osy MP 2
Osy MP 2
Osy MP 2
2022-2023
A PROJECT REPORTON
SUBMITTED BY
GUIDED BY:
PROF.M.M.GOSWAMI
Department of Computer Engineering Government
Polytechnic, Nandurbar
2022-2023
GOVERNMENT POLYTECHNIC, NANDURBAR
CERTIFICATE
1. KIRTAN SHIMPI
2. GAYATRI PATIL
3. LALIT BORSE
4 YASH KASAR
5. SONALI PATIL
The said work has been a ssessed by me and I satisfied with same is up tothe
SUBMISSION
The following student were associated with me for this work however, quantum of my
contribution has been approved by teacher.
1. KIRTAN SHIMPI
2. GAYATRI PATIL
3. LALIT BORSE
4. YASH KASAR
5. SONALI PATIL
I have not copied the report or it’s any appreciable part from any other Literature
connection with academic ethics.
Signature of Lecturer
PROF.M.M.GOSWAMI
INDEX
Report Part(A)
3. Proposed Methodology
4. Action Plan
1. Rationale
2. Aim of Micro-Project
4. Literature Review
7. Project Output
8. Skills Developed
In this micro project we may like to put forth information about Round
Robin Scheduling Algorithm. Round Robin (RR) scheduling algorithm is
widely used scheduling algorithm in multitasking. It ensures fairness and
starvation free execution of processes. Choosing the time quantum in RR
is very crucial as small time slice results in large number of context
switches and large time quantum increases the response time.
Experimental analysis reveals that the proposed algorithm produces
better average turnaround time, average waiting time and fewer number
of context switches than existing algorithms.
4.0: ACTION PLAN:
Planned Planned
Name of
Sr.no Details of Activity Start Finish
Responsibilities
date date
Searched and selected the topic for
1
micro project.
2 Discussed about the micro project.
1. Operating System Concepts – Silberchatz, Galvin – John Wiley and Sons, Ninth
Edition, 2015, ISBN: 978-51-265-5427-0
2. Operating System – Godbole, Achyut S. – Tata McGraw Hill Education, 2015,
ISBN: 978-00-705-9113-4
3. Operating System – Dr. Rajendra Kawale – Devraj Publications, Mumbai, ISBN:
978-81-933551-1-4
Electronic Sources:
1. https://en.wikipedia.org/wiki/Round-robin_scheduling
2. https://www.irjet.net/archives/V3/i3/IRJET-V3I3285.pdf
3. https://www.thecrazyprogrammer.com/2015/09/round-robin-scheduling-program-in-
c.html
1.0: RATIONALE:
Round Robin (RR) scheduling algorithm is widely used scheduling algorithm in
multitasking. It ensures fairness and starvation free execution of processes. Choosing
the time quantum in RR is very crucial as small time slice results in large number of
context switches and large time quantum increases the response time. Experimental
analysis reveals that the proposed algorithm produces better average turnaround
time, average waiting time and fewer number of context switches than existing
algorithms.
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. One of the most commonly used technique in CPU scheduling as a core. It
is preemptive as processes are assigned CPU only for a fixed slice of time at the most. The
disadvantage of it is more overhead of context switching.
5.0 : ACTUAL METHODOLOGY FOLLOWED:
Description:
The Round Robin (RR) scheduling algorithm is designed especially for time sharing
systems. RR is the pre-emptive process scheduling algorithm.
Round robin scheduling is the pre-emptive version of First Come First Serve (FCFS)
scheduling. Processes are dispatched in First In First Out (FIFO) sequence but each
process is allowed to run for only a limited amount of time.
It is similar to FCFS scheduling but pre-emption is added to switch between processes.
A small unit of time called a Time Quantum or Time Slice is defined.
A time quantum is generally from 10 to 100 milliseconds. The ready queue is treated
as a circular queue. The CPU scheduler goes around the ready queue, allocating CPU
to each process for a time interval of up to 1 time quantum.
In RR scheduling process are dispatched FIFO but are given a limited amount of
processor time called a time slice or time quantum.
If a process does not complete before its quantum expires, the system preempts it
and gives the processor to the next waiting process. The system then places the pre-
empted process at the back of the ready queue.
In the fig. process P1 is dispatched to a processor, where it executes either until
completion, in which case it exits the system, or until its time slice expires, at which
point is pre-empted and placed at the tail of the ready queue. The scheduler then
dispatches process P2.
Dispatch
A B C D CPU Completed Job
Preemption
Timeout
Assume there are 5 processes with process ID and burst time given below
Time quantum
Assume that all process arrives at 0.
Now, we will calculate average waiting time for these processes to complete.
Solution:
We can represent execution of above processes using GANTT chart as shown below –
First p1 process is picked from the ready queue and executes for 2 per unit time (time
slice = 2). If arrival time is not available, it behaves like FCFS with time slice.
After P2 is executed for 2 per unit time, P3 is picked up from the ready queue. Since
P3 burst time is 2 so it will finish the process execution at once.
Like P1 & P2 process execution, P4 and p5 will execute 2 time slices and then again it
will start from P1 same as above.
Waiting time = Turn Around Time – Burst Time
P1 = 19 – 6 = 13
P2 = 20 – 5 = 15
P3 = 6 – 2 = 4
P4 = 15 – 3 = 12
P5 = 23 – 7 = 16
Average waiting time = (13+15+4+12+16) / 5 = 12.
Flowchart:
C Program code:
#include<stdio.h>int
main()
{
int count,j,n,time,remain,flag=0,time_quantum;
int wait_time=0,turnaround_time=0,at[10],bt[10],rt[10];
printf("Enter Total Process:\t ");
scanf("%d",&n);
remain=n;
for(count=0;count<n;count++)
{
printf("Enter Arrival Time and Burst Time for Process Process
Number %d :",count+1);
scanf("%d",&at[count]);
scanf("%d",&bt[count]);
rt[count]=bt[count];
}
printf("Enter Time Quantum:\t");
scanf("%d",&time_quantum);
printf("\n\nProcess\t|Turnaround Time|Waiting Time\n\n");
for(time=0,count=0;remain!=0;)
{
if(rt[count]<=time_quantum && rt[count]>0)
{
time+=rt[count];
rt[count]=0;
flag=1;
}
else if(rt[count]>0)
{
rt[count]-=time_quantum;
time+=time_quantum;
}
if(rt[count]==0 && flag==1)
{
remain--;
printf("P[%d]\t|\t%d\t|\t%d\n",count+1,time-at[count],time-
at[count]-bt[count]);
wait_time+=time-at[count]-bt[count];
turnaround_time+=time-at[count];
flag=0;
}
if(count==n-1)
count=0;
else if(at[count+1]<=time)
count++;
else
count=0;
}
printf("\nAverage Waiting Time= %f\n",wait_time*1.0/n);
printf("Avg Turnaround Time = %f",turnaround_time*1.0/n);
return 0;
}
1. Operating System Concepts – Silberchatz, Galvin – John Wiley and Sons, Ninth
Edition, 2015, ISBN: 978-51-265-5427-0
2. Operating System – Godbole, Achyut S. – Tata McGraw Hill Education, 2015,
ISBN: 978-00-705-9113-4
Electronic Sources:
1. https://en.wikipedia.org/wiki/Round-robin_scheduling.
2. https://www.irjet.net/archives/V3/i3/IRJET-V3I3285.pdf.
3. https://www.thecrazyprogrammer.com/2015/09/round-robin-scheduling-program-in-
c.html.
7.0: OUTPUT OF THE PROGRAM:
: SKILLS DEVELOPED:
2. Information
collection/literature
survey
3. Project proposal
4. Completion of the target
as per project proposal
9. Defence
Signature of Faculty