Professional Documents
Culture Documents
MICROPROJECT REPORT
ON
“Program in ‘C’ for Round Robin Scheduling algorithm”
SUBMITTED
BY
14 Sejal Thorat
61 Ashutosh Salave
Under Guidance of -
Mrs. A. V. Kurkute
PUNE - 411041
Certificate
This is to certify that Ms. Rutuja Ravikiran Limkar with Roll
No. 25 of Fifth Semester of Diploma in Computer Technology of
Institute Sou. Venutai Chavan Polyechnic (Code : 0040) has
successfully completed the Micro-Project in Operating System
(22516) for the academic year 2020-2021.
Certificate
This is to certify that Ms. Sejal Ganesh Thorat with Roll No. 14
of Fifth Semester of Diploma in Computer Technology of
Institute Sou. Venutai Chavan Polyechnic (Code : 0040) has
successfully completed the Micro-Project in Operating System
(22516) for the academic year 2020-2021.
Certificate
This is to certify that Mr. Ashutosh Salave with Roll No. 61 of
Fifth Semester of Diploma in Computer Technology of Institute
Sou. Venutai Chavan Polyechnic (Code : 0040) has successfully
completed the Micro-Project in Operating System (22516) for the
academic year 2020-2021.
SR NO CONTENTS PAGE NO
1 Rationale 3
4 Literature Review 3
6 Output of microproject 9
8 Skills Developed 10
Annexure - I
Part A - Micro-Project Proposal
“Program in ‘C’ for Round Robin Scheduling algorithm”
Rutuja Limkar
1 Searched and selected the
02/09/2020 08/09/2020
topic for microproject. Sejal Thorat
Rutuja Limkar
Discussed about the micro
2 09/09/2020 15/09/2020
project. Sejal Thorat
Rutuja Limkar
3 Distributed the work
16/09/2020 22/09/2020
accordingly. Sejal Thorat
Rutuja Limkar
4 Collected and gathered the 23/09/2020 30/09/2020
required data. Sejal Thorat
Rutuja Limkar
5 Started working on the 03/10/2020 09/10/2020
code. Sejal Thorat
Rutuja Limkar
6 Created the first basic steps 10/10/2020 16/10/2020
for the project. Sejal Thorat
Rutuja Limkar
7 Debugged the errors. 02/11/2020 12/11/2020
Sejal Thorat
Rutuja Limkar
Analyze the report and
8 make changes if required. 06/12/2020 12/12/2020 Sejal Thorat
Ashutosh Salave
Rutuja Limkar
9 Edited and prepared the 14/12/2020 21/12/2020 Sejal Thorat
final report.
Ashutosh Salave
Team Members
Roll No. Name
25 Rutuja Limkar
14 Sejal Thorat
61 Ashutosh Salave
Annexure – II
Micro-Project Report
On
“Program in ‘C’ for Round Robin scheduling algorithm”
6.0 Rationale –
Round Robin (RR) scheduling algorithm is widely used scheduling algorithm inmultit
asking. It ensures fairness and starvation free execution of processes. Choosingthe tim
e quantum in RR is very crucial as small time slice results in large number ofcontext s
witches and large time quantum increases the response time. Experimentalanalysis rev
eals that the proposed algorithm produces better average turnaroundtime, average wait
ing time and fewer number of context switches than existing algorithms.
The name of the algorithm comes from the round-robin principle known from other
fields, where each person takes an equal share of something in turn.
and type. All the required scheduling algorithms to workover real time environment
with special reference to task, control and efficiency. Many researches have introduced
various CPU scheduling algorithms from time to time.
Round Robin is a CPU scheduling algorithm where each process is assigned a fixed ti
meslot in a cyclic way. It is simple, easy to implement.
And starvation-
free as all processes getfair share of CPU. One of the most commonly used technique
in CPU scheduling as a core. Itis preemptive as processes are assigned CPU only for a
fixed slice of time at the most. Thedisadvantage of it is more overhead of context
switching.
• The Round
robin(RR) scheduling algorithm is designed especially for time sharingsystems. RR i
s the pre-emptive process scheduling algorithm.
• Round robin scheduling is the preemptive version of First Come First Serve (FCFS)
scheduling. Processes are dispatched in First In First Out (FIFO) sequence but eachp
rocess is allowed to run for only a limited amount of time.
• A time quantum is generally from 10 to 100 milliseconds. The ready queue is treate
das a circular queue. The CPU scheduler goes around the ready queue, allocating C
PU 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 ofpro
cessor time called a time slice or time quantum.
• If a process does not complete before its quantum expires, the system preempts itand
gives the processor to the next waiting process. The system then places the pre-
• In the fig. process P1 is dispatched to a processor, where it executes either until com
completion, in which case it exits the system, or until its time to slice expires, at which
points is preempted and placed at the tail of the ready queue. The scheduler then
dispatches process P2.
• Advantages –
• Disadvantages –
3. Setting the quantum too short, increases the overhead and lowers the CPU
efficiency, but setting it too long may cause poor response to short processes.
4. Average waiting time under the RR policy is often long.
• Time quantum.
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 & executes for 2 per unit time(ti
meslice = 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. Si
nceP3 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 a
gain itwill start from P1 same as above.
P1 = 19–6 = 13
P2 = 20 –5 = 15
P3 = 6 –2 = 4
P4 = 15 –3 = 12
P5 = 23 – 7=16
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==n1)
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;
}