Os Micro
Os Micro
MICRO PROJECT
TITLE OF PROJECT
Scanned by CamScanner
MAHARASHTRA STATE
Certificate
This is to certify that
Mr./MsVinodMarne,NakulSharma,DipakPernekar,ShrawanBora Roll
No.16,13,11,21 of TYCO 5th Semester of Diploma in Computer Engineering
ofInstitute, BSCOER POLYTECNIC (Code: 1606) has completed the
Scanned by CamScanner
Group Details:
No No
Scanned by CamScanner
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
Scanned by CamScanner
1.0: AIM OF MICROPROJECT:
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.
Scanned by CamScanner
1.3: RESOURCES REQUIRED:
Books:
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
Scanned by CamScanner
Scanned by CamScanner
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.
Scanned by CamScanner
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.
Scanned by CamScanner
To implement RR scheduling we keep ready queue as FIFO queue of processes. New processes are
added to the tail of the ready queue. The average waiting time under the RR policy however is often
quite long.
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 –
Explanation:
First p1 process is picked from the ready queue and executes for 2 per unit time (timeslice = 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. SinceP3 burst time is 2
so it will finish the process execution at once.
Scanned by CamScanner
Like P1 & P2 process execution, P4 and p5 will execute 2 time slices and then again itwill start from P1
same as above.
Flowchart:
Scanned by CamScanner
C program code:
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;
Scanned by CamScanner
}
if(count==n-1)
count=0;
else
if(at[count+1]<
=time) count++;
else
count=0;
}
Scanned by CamScanner
7.0: OUTPUT OF THE PROGRAM:
Scanned by CamScanner
8.0: SKILLS DEVELOPED:
This can be used as reference for people who want to learn Round Robin
Algorithm. This algorithm dramatically improves average response time. By limiting
each task to a certain amount of time, the operating system can ensure that it can
cycle through all ready tasks, giving each one a chance to run.
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
Scanned by CamScanner
WEEKLY PROGRESS REPORT
MICROPROJECT
10 10th Seminar
Scanned by CamScanner
Evaluation Sheet for the Micro Project
Semester: V
Title of the project:” PROGRAM IN ‘C’ FOR ROUND ROBIN SCHEDULING ALGORITHM”
16 VINOD
MARNE
13 NAKUL SHARMA
11 DIPAK PERNEKAR
21 SHRAWAN BORA
Scanned by CamScanner