0% found this document useful (0 votes)
274 views

OSY Microproject

The document summarizes a micro-project on implementing the First Come First Serve (FCFS) CPU scheduling algorithm. It includes the rationale for using process scheduling, benefits of the micro-project, course outcomes achieved, literature review on FCFS algorithm features and limitations, methodology followed including an example calculation and code to find waiting time, turnaround time and average times.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
274 views

OSY Microproject

The document summarizes a micro-project on implementing the First Come First Serve (FCFS) CPU scheduling algorithm. It includes the rationale for using process scheduling, benefits of the micro-project, course outcomes achieved, literature review on FCFS algorithm features and limitations, methodology followed including an example calculation and code to find waiting time, turnaround time and average times.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Annexure II

Evolution sheet for Micro Project


Academic Year: - 2022-23 Name of Faculty: - Ms. Muttagi.V.R
Course: - Information Technology Course code: - IF5I
Subject:- Operating System Subject Code: -22516
Semester: - 5 Scheme: - I
Title of
Project: - “First Come First Serve (FCFS) Algorithm”.
COs addressed by the Micro Project:
A: - Apply scheduling algorithm to calculate turnaround time and average waiting time.
Major Learning Outcomes achieved by students by doing the Project:

Write a program to calculate total waiting and turnaround time of


(a)Practical Outcomes: n process with First Come First CPU scheduling algorithm.

Calculate turnaround time and average waiting time of the given


(b) Unit Outcomes in Cognitive scheduling algorithm.
domain:

1. Follow precautionary measures.


2. Follow naming conventions.
(c) Outcomes in Affective Domain:
3. Follow ethical practices.

Comments/Suggestions about teamwork/leadership/inter-personal communication (if any)

Marks out
Marks out
of 6 for
of 4 for Total marks
Roll No Name of student performan
performance in out of
ce in group
oral/Presentation 10
activity
20 Shingade Pratik Sukhadev
49 More Karan Sadanand
69 Kature Mayur Rajendra
76 Tamboli Musif Husen
Name &
Signature
of faculty ( Ms.Muttagi.V.R)

1
A PROJECT REPORT ON
“ First Come First Serve (FCFS) Algorithm”.
Submitted in partial fulfillment of the requirements of the award of degree
Of
DIPLOMA ENGINEERING
In

Information Technology
BY:-

Roll No Name Enrollment No


20 Shingade Pratik Sukhadev 2010740294
49 More Karan Sadanand 2010740326
69 Kature Mayur Rajendra 2110740497
76 Tamboli Musif Husen 2110740504

UNDER THE GUIDANCE:


Ms. Muttagi V.R

SVERI’S
COLLEGE OF ENGINEERING (POLY). PANDHARPUR
2022-23

2
CERTIFICATE
The project-report entitled – “ First Come First Serve (FCFS) Algorithm ” .

submitted by
Roll No Name
20 Shingade Pratik Sukhadev
49 More Karan Sadanand
69 Kature Mayur Rajendra
76 Tamboli Musif Husen

Is approved for the Diploma of Engineering in Information Technology


from SVERI’S College of Engineering (Polytechnic), Pandharpur.

Name of Guide Name of H.O.D


(Ms. Muttagi. V.R) (Mr.Misal. G.S)
Department of IT Engineering Department of IT Engineering
SVERI’S COE(poly), Pandharpur. SVERI’S COE(poly), Pandharpur.

Examiner Principal
(Prof. ) (Prof.Dr.N.D. Misal)

Date:
Place: Pandharpur

3
ACKNOWLEDGEMENT
I take this opportunity to express my sincere thanks and deep sense of gratitude to
my guide, Ms.Muttagi.V.R madam for his constant support, motivation, valuable guidance
and immense help during the entire course of this work. Without his constant
encouragement, timely advice and valuable discussion, it would have been difficult in
completing this work. I would also like to acknowledge Computer Department who
provided me the facilities for completion of the project. We are thankful to him for sharing
his experienced in research field with me and providing constant motivation during entire
principle.

Name of Students :-

Roll No Name
20 Shingade Pratik Sukhadev
49 More Karan Sadanand
69 Kature Mayur Rajendra
76 Tamboli Musif Husen

4
First Come First Serve (FCFS) Algorithm

1. RATIONALE:
Process Scheduling is an OS task that schedules processes of different states like ready,
waiting, and running. Process scheduling allows OS to allocate a time interval of CPU
execution for each process. Another important reason for using a process scheduling system
is that it keeps the CPU busy all the time. This allows you to get the minimum response time
for programs. It is done by various scheduling algorithms used by short-term scheduler, one
of them is a First Come First Serve (FCFS) algorithm.

2. Benefits of the Micro-Project:


1) The simplest form of a CPU scheduling algorithm.
2) Easy to program.
3) First come first served.

3. Course Outcomes Achieved:


a) Apply scheduling algorithm to calculate turnaround time and average waiting time.

4. Literature Review:
FCFS is the simplest scheduling algorithm. There is a single rule; schedule the first process
to arrive, and let it run to completion. This is a non-preemptive scheduling algorithm, which
means that only a single process can run at a time, regardless of whether it uses the resources
of the system effectively, and also regardless of whether there is a queue of other processes
waiting, and the relative importance of those processes. Due to these limitations, the
algorithm is not widely used but is included here as a baseline on which to compare other
simple algorithms [1].

Features of First Come First Serve Algorithm :-


1) It is a non-preemptive scheduling algorithm.
2) Jobs are always executed on a first-come, first-serve basis.
3) It is easy to implement and use.
4) This method is poor in performance, and the general wait time is quite high.

5
5. Actual methodology Followed:

FCFS is the simplest CPU scheduling algorithm. With this algorithm, processes are
assigned the CPU in the order they request it. Basically, there is a single queue of ready
processes. Relative importance of jobs measured only by arrival time. The implementation of the
FCFS policy easily managed with a FIFO queue. When a process enters the ready queue, its
PBC is linked onto the tail of the queue. The average waiting time under the FCFS policy,
however, IS often quite long.

Example
Consider the processes P1, P2, P3, P4 given in the below table, arrives for execution in the same
order, with Arrival Time 0, and given Burst Time, let's find the waiting time, average waiting
time, turn around time, average turn around time using the FCFS scheduling algorithm.

Process Burst time


P1 6
P2 2
P3 8
P4 3

Solution: -

Gantt Chart:

P2 P4 P1 P3
0 2 5 11 19

6
Waiting Time:
1. P1=5
2. P2=0
3. P3=11
4. P4=2

Average Waiting Time:


P1+P2+P3+P4 ÷ 4
5+0+11+2 ÷ 4 = 4.5 ms
The average waiting time will be 4.5 ms

Code
#include<iostream>
using namespace std;
void findWaitingTime(int processes[], int n, int bt[], int wt[])
{
wt[0] = 0;
for (int i = 1; i < n ; i++)
{
wt[i] = bt[i-1] + wt[i-1];
}
}
void findTurnAroundTime( int processes[], int n, int bt[], int wt[], int tat[])
{
for (int i = 0; i < n ; i++)
{
tat[i] = bt[i] + wt[i];
}

7
}
void findAverageTime( int processes[], int n, int bt[])
{
int wt[n], tat[n], total_wt = 0, total_tat = 0;
findWaitingTime(processes, n, bt, wt);
findTurnAroundTime(processes, n, bt, wt, tat);
cout << "Processes "<< " Burst time "<< " Waiting time " << " Turn around time\n";
for (int i = 0; i < n; i++)
{
total_wt = total_wt + wt[i];
total_tat = total_tat + tat[i];
cout << " " << i+1 << "\t\t" << bt[i] <<"\t "<< wt[i] <<"\t\t " << tat[i] <<endl;
}
cout << "Average waiting time = "<< (float)total_wt / (float)n;
cout << "\nAverage turn around time = "<< (float)total_tat / (float)n;
}
int main()
{
int processes[] = { 1, 2, 3, 4};
int n = sizeof processes / sizeof processes[0];
int burst_time[] = {21, 3, 6, 2};
findAverageTime(processes, n, burst_time);
return 0;
}

8
6. Actual Resources Used:

S. No. Name of Specifications Qty Remarks


Resource/material

1 Laptop Windows 10 Pro, Core i5 Processor 1


,RAM 8 GB DDR4,
HDD 1 TB + 512 GB SSD
2 Turbo C++ Version 3.7.1 1

7. Outputs of the Micro-Project:


Output

 In this way we have implemented the first come first serve algorithm with example.

9
8. Learning Outcomes of this Micro-Project:

1) We are able to calculate turnaround time and average waiting time of the
given scheduling algorithm
2) We have gained ability to develop such projects.
3) Coding knowledge has improved due to such projects.

9. Applications of this Micro-Project:

1) In Batch OS, Batch Monitor uses FCFS scheduling algorithm to schedule batches.
2) Used in online reservation systems, ex- railway reservation.
3) Spooling in printers.
4) Buffer for devices like keyboard.

References

1. https://www.sciencedirect.com/topics/computer-science/first-come-first-
servedhttps://www.sciencedirect.com/topics/computer-science/first-
come-first-served
2. https://www.geeksforgeeks.org/program-for-fcfs-cpu-scheduling-set-1/
3. https://en.wikipedia.org/wiki/Scheduling_(computing)
4. https://en.wikibooks.org/wiki/Operating_System_Design/Scheduling_Pro
cesses/FCFS
5. https://www.techopedia.com/definition/23455/first-come-first-served-fcfs

10

You might also like