You are on page 1of 15

A

MICROPROJECT REPORT
ON
“Program in ‘C’ for Round Robin Scheduling algorithm”

SUBMITTED
BY

Roll No Name of Group Members


25 Rutuja Limkar

14 Sejal Thorat

61 Ashutosh Salave

Under Guidance of -
Mrs. A. V. Kurkute

Diploma Course in Computer Technology


(As per directives of I Scheme, MSBTE)

Sinhgad Technical Education Society’s

SOU.VENUTAI CHAVAN POLYTECHNIC,

PUNE - 411041

ACADEMIC YEAR 2020-2021


Maharashtra State
Board of technical Education

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.

Place: SVCP, Pune Enrollment No:1900400257


Date: Exam Seat No:

Mrs. A V Kurkute Mrs. A V Kurkute Dr. (Mrs) M S Jadhav


Subject Teacher Head of the Principal
department
Maharashtra State
Board of technical Education

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.

Place: SVCP, Pune Enrollment No:1900400250


Date: Exam Seat No:

Mrs. A V Kurkute Mrs. A V Kurkute Dr. (Mrs) M S Jadhav


Subject Teacher Head of the Principal
Department
Maharashtra State
Board of technical Education

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.

Place: SVCP, Pune Enrollment No:1410820112


Date: Exam Seat No:

Mrs. A V Kurkute Mrs. A V Kurkute Dr. (Mrs) M S Jadhav


Subject Teacher Head of the Principal
department
INDEX

SR NO CONTENTS PAGE NO

1 Rationale 3

2 Aim of the Micro-Project 3

3 Course Outcomes Addressed 3

4 Literature Review 3

5 Actual Methodology Followed 4

6 Output of microproject 9

7 Actual Resources Used 10

8 Skills Developed 10

9 Applications of Micro Project 10


Program in ’C’ for Round Robin Scheduling algorithm

Annexure - I
Part A - Micro-Project Proposal
“Program in ‘C’ for Round Robin Scheduling algorithm”

1.0 Aim of the Micro-Project -


To develop a Program in ‘C’ for Round Robin Scheduling algorithm.

2.0 Intended Course Outcomes –


d) Apply scheduling algorithms to calculate turnaround time and average
waiting time.

3.0 Proposed methodology –


Step I :- Searched and Selected the topic for micro project.
Step II:- Discussed about the microproject.
Step II :- Distributed the work accordingly.
Step III :- Collected and gathered the required data.
Step IV :- Develop a code then test the code and remove errors if any.

Step V :- Process information in one document.


Step VI :- Consulted with our subject teacher.

4.0 Action Plan

Sr. Planned Planned Name of responsible


Details of Activity
No. Start Date Finish Date Team members

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

Department of Computer Technology academic year 2020-21 1


Program in ’C’ for Round Robin Scheduling algorithm

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

5.0 Resources Required -


Name of the Resources
Sr. No. Specifications
required
1 Computer system Processor i7 RAM-8GB
2 Operating System Windows 10
3 Web Browser Internet Explore, Mozilla Firefox

Team Members
Roll No. Name

25 Rutuja Limkar

14 Sejal Thorat

61 Ashutosh Salave

Department of Computer Technology academic year 2020-21 2


Program in ’C’ for Round Robin Scheduling algorithm

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.

Round-robin (RR) is one of the algorithms employed by process and network


schedulers in computing. As the term is generally used, time slices (also known as time
quanta) are assigned to each process in equal portions and in circular order, handling
all processes without priority (also known as cyclic executive). Round-robin
scheduling is simple, easy to implement, and starvation-free. Round-robin scheduling
can be applied to other scheduling problems, such as data packet scheduling in
computer networks. It is an operating system concept.

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.

7.0 Aim of the Micro-Project –


To develop a Program in ‘C’ for Round Robin Scheduling algorithm.

8.0 Course Outcomes Achieved –


d) Apply scheduling algorithms to calculate turnaround time and average
waiting time.

9.0 Literature Review-


The operating system plays a major role in managing processes arriving in the form of
multiple queue. The arrival of process ais random along with therir different categories

Department of Computer Technology academic year 2020-21 3


Program in ’C’ for Round Robin Scheduling algorithm

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.

10.0 Actual Methodology Followed-


Description:

• 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.

• It is similar to FCFS scheduling but pre-


emption is added to switch between processes.A small unit of time called a Time Qu
antum or Time Slice is defined.

• 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-

Department of Computer Technology academic year 2020-21 4


Program in ’C’ for Round Robin Scheduling algorithm

empted process at the back of the ready queue.

• 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.

Fig – Round Robin Scheduling

• To implement RR scheduling we keep ready queue as FIFO queue of process.New


Processor are added to the tail of the ready queue. The average waiting time under
the RR policy however is often quite long.

Advantages and disadvantages-

• Advantages –

1. Every process gets an equal share of the CPU.


2. RR is cyclic in nature, so there is no starvation.

• 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.

Department of Computer Technology academic year 2020-21 5


Program in ’C’ for Round Robin Scheduling algorithm

Example of round robin scheduling algorithm:


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-

Fig- Gantt Chart

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.

Department of Computer Technology academic year 2020-21 6


Program in ’C’ for Round Robin Scheduling algorithm

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:

Department of Computer Technology academic year 2020-21 7


Program in ’C’ for Round Robin Scheduling algorithm

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]);

Department of Computer Technology academic year 2020-21 8


Program in ’C’ for Round Robin Scheduling algorithm

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;
}

11.0 Output of Microproject-

Department of Computer Technology academic year 2020-21 9


Program in ’C’ for Round Robin Scheduling algorithm

12.0 Actual Resources Used –


Name of the Resources
Sr. No. Specifications
required
1 Computer system Processor i7 RAM-8GB
2 Operating System Windows 10
3 Web Browser Internet Explore, Mozilla Firefox

13.0 Skills Developed -


a) After working on the allotted microproject topic, I gained various skills like
working in team, making coordination between team members.
b) This project also made me increase my observational skills.
c) Such project work increases our knowledge other from the regular course work.

14.0 Applications of this Micro-project –


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
acertainamount of time, the operating system can ensure that it can cycle through all
ready tasks, giving each one a chance to run.

Department of Computer Technology academic year 2020-21 10

You might also like