Microproject

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 18

A

PROJECT REPORT
ON
“Program In ‘C’ For Round Robin Scheduling Algorithm”
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE
AWARD OF DIPLOMA IN COMPUTER ENGINEERING

SUBMITTED TO
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION, MUMBAI

SUBMITTED BY

Name of Student Roll No


1. Shinde Dinesh Balu 06

GUIDED BY: (Prof. Nawale S.K.)

SAMARTH POLYTECHNIC, BELHE


CERTIFICATE

This is to certify that the project report entitled “Program In ‘C’ For Round Robin
Scheduling Algorithm” Was successfully completed by student of fifth semester
diploma in computer engineering.

Name of Student Roll No


1. Shinde Dinesh Balu 06

In partial fulfillment of the requirements for the award of the diploma in computer
engineering and submitted to the department of computer of samarth polytechnic,
belhe work carried out during a period for the academic year 2023-24 as per
curriculum .

Prof.Nawale S.K. Prof. Nawale S.K. Prof. Kapile.A.S.


(Subject Teacher) (H.O.D) (Principal)
ACKNOWLEDGMENT

This project is done as a semester project, as a part course titled


“Program In ‘C’ For Round Robin Scheduling Algorithm”

I’m really thankful to our course the principal Prof. Kapile A.S. and the HOD
Prof.Nawale S.K. samarth polytechnic, belhe for his invaluable guidance and
assistance, without which the accomplishment of the task would have never been
possible.

I also thanks Prof. Nawale S.K. for giving this opportunity to explore into the real
world and realize the interrelation without which a Project can never progress. In this
present project I have chosen the topic- “Program In ‘C’ For Round Robin
Scheduling Algorithm”

I also thankful to parents, friend and all staff of computer engineering department,
for providing us relevant information and necessary clarifications, and great support.

Name of Student Roll No

1. Shinde Dinesh Balu 06


ANNEXURE II
Evaluation Sheet for Micro Project

Academic Year:-2023-24 Name of Faculty:- Prof. Nawale S.K. Course: Computer Engineering
Course Code :- CO-5I Subject Code :- 22516 Semester:-V
Title of Project: “”

oCos addressed by the micro project :-


..................................................................................................................................................................................
..................................................................................................................................................................................
..................................................................................................................................................................................
..................................................................................................................................................................................
..................................................................................................................................................................................
..................................................................................................................................................................................
......
Major Learning Outcomes achieved by students by doing the project:-

a) PracticalOutcomes..................................................................................................................................................
..................................................................................................................................................................................
.............................................................................................................................................

b) Unit Outcomes in Cognitive domain


....................................................................................................................................................................................
....................................................................................................................................................................................
................................................................................................................................................
c) Outcomes in Affective Domain
....................................................................................................................................................................................
....................................................................................................................................................................................
................................................................................................................................................

Marksoutof4
Marksoutof6
For performance in
Roll For performance
Student Name oral / Total out of 10
No. in group
presentation(D5
activity(D5 Col.8)
Col.9)

07 Shinde Dinesh Balu

Prof.Nawale S.K.
(Name & Signature of Faculty)
INDEX
Sr.No. Name of content

01 Rationale

02 Aim of the Micro-Project


03 Course Outcomes

04 Actual Methodology Followed

05 Advantages and Disadvantages


06 Flowchart
07 Program
08
output
MICRO-PROJECT REPORT

Rationale :-
A round robin is an arrangement of choosing all elements in a
group equally in some rational order, usually from the top to the
bottom of a list and then starting again at the top of the list and so
on. 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. Experiment analysis reveals that the proposed algorithm
produces better average turnaround time, average waiting time and
fewer number of context switches than existing algorithms.

Aim Of The Microproject :-


To develop a Program in ‘C’ for Round Robin Scheduling
algorithm.
Course Outcomes :-
 Install operating system and configure it.
 Use operating system tools to perform various functions.
 Execute process commands for performing process
management operations.
 Apply scheduling algorithms to calculate turnaround time

and average waiting time.

Actual Methodology Followed :-


Description –
 The Round Robin (RR) scheduling algorithm is specially
used for time sharing systems.It is quite same like quite same
like FCFS,only difference is that in Round Robin algorithm
preamption is added to switch from one process to another
process.
 A small unit of time is called as time quantum.It is also
known as time slice.A time quantum is generally from 10 to
100 miliseconds.In this method a ready queue is considered
and treated as a circular queue.
 The CPU scheduler takes round along the ready queue and
allocates CPU to each an every process for a time interval of
up to 1 time quantum.
 For implementing round robin scheduling,the processes are
kept in FIFO (First In First Out) order.The new processes are
added to the tail i.e the last position of ready queue.
 The scheduler picks one job and assigns it to CPU;CPU
executes it and bursts for a time quantum.In this case there
are possibilities.
 If time quantum of processer is greater than process burst
time then process itself releases CPU,otherwise interrupt
interrupts the CPU.then CPU stops the execution and the
process is shifted to tail of the ready process queue.after
this,CPU scheduler selects next job for execution.
 The average waiting time in case of RR algorithm is genrally
longer.
 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.

Example of round robin scheduling algorithm:-


Assume there are 5 processes with process ID and burst time given below
PID Burst Time

P1 6

P2 5

P3 3

P4 2

P5 7

Time quantum=2.

 Assume that all process arrives at 0.


 Now, We will calculate average waiting time for this process to
complete.

Advantages of Round Robin Algorithm


 No issues of starvation or convoy effect.
 Every job gets a fair allocation of CPU.
 No priority scheduling is involved.
 Total number of processes on the run queue helps assume the worst-
case response time for a process.
 Doesn't depend on burst time and is easily implementable.

Disadvantages of Round Robin Algorithm


 Low slicing time reduces processor output.
 Spends more time on context switching.
 Performance depends on time quantum.
 Decreases comprehension.
 Higher context switching overhead due to lower time
quantum.

Flowchart:-
C Code For Round Robin Scheduling Algorithm
#include<stdio.h>
#include<conio.h>
void main()
{
// initlialize the variable name
int i, NOP, sum=0,count=0, y, quant, wt=0, tat=0, at[10], bt[10], temp[10];
float avg_wt, avg_tat;
printf(" Total number of process in the system: ");
scanf("%d", &NOP);
y = NOP; // Assign the number of process to variable y
// Use for loop to enter the details of the process like Arrival time and the
Burst Time
for(i=0; i<NOP; i++)
{
printf("\n Enter the Arrival and Burst time of the Process[%d]\n", i+1);
printf(" Arrival time is: \t"); // Accept arrival time
scanf("%d", &at[i]);
printf(" \nBurst time is: \t"); // Accept the Burst time
scanf("%d", &bt[i]);
temp[i] = bt[i]; // store the burst time in temp array
}
// Accept the Time qunat
printf("Enter the Time Quantum for the process: \t");
scanf("%d", &quant);
// Display the process No, burst time, Turn Around Time and the waiting
time
printf("\n Process No \t\t Burst Time \t\t TAT \t\t Waiting Time ");
for(sum=0, i = 0; y!=0; )
{
if(temp[i] <= quant && temp[i] > 0) // define the conditions
{
sum = sum + temp[i];
temp[i] = 0;
count=1;
}
else if(temp[i] > 0)
{
temp[i] = temp[i] - quant;
sum = sum + quant;
}
if(temp[i]==0 && count==1)
{
y--; //decrement the process no.
printf("\nProcess No[%d] \t\t %d\t\t\t\t %d\t\t\t %d", i+1, bt[i], sum-at[i],
sum-at[i]-
bt[i]);
wt = wt+sum-at[i]-bt[i];
tat = tat+sum-at[i];
count =0;
}
if(i==NOP-1)
{
i=0;
}
else if(at[i+1]<=sum)
{
i++;
}
else
{
i=0;
}
}
}

Output :-
Actual Resources Used:
Sr.no Resource Specifications
1. Computer System Processor Intel Core I3, RAM
8GB, 1TB.HDD
2. Operating System Windows 10
3. Software Turbo C++, Ubantu
4. Microsoft Word Microsoft office 2010

Skill Developed :

 From this we learnt about CPU scheduling in operating system.

 Also, we got to know about finding average waiting time and


average turnaround time each process executing in operating
system.

 Round Robin scheduling is an algorithm mainly used by operating


systems and applications that serve multiple clients that request to
use resources

Applications of this Micro - Project :

Round-Robin is a useful tool for having your team generate ideas,


without being influenced unduly by others in the group. This method
also used to ensures that everyone on your team gets an equal say in the
ideas that you generate. We can use either the written and verbal
variations of this technique.

Area of Future Improvement :


We can improve performance for round robin by arranging processes in
an increasing order according to the burst time, then calculating the
mean of the burst time as quantum time finally calculating turnaround
time and waiting time, thus to obtain better results comparing with the
standard RR.
Thank You

You might also like