Introduction to OS
Introduction to OS
SESSION : 2024-2025
1
CONTENT
07 Conclusion 11
08 References 12
2
ABSTARCT
The First-Come, First-Served (FCFS) CPU Scheduling Algorithm is a foundational and
widely studied method in the field of operating systems. As the simplest scheduling
algorithm, it operates on a non-preemptive, first-in-first-out basis, prioritizing processes in
the exact sequence of their arrival in the ready queue. The algorithm ensures fairness, as no
process can overtake another in the queue. However, its straightforward nature leads to
significant inefficiencies, such as the "convoy effect," where long processes delay the
execution of shorter ones, resulting in suboptimal system performance. While FCFS is easy
to implement and serves as an introductory concept, its inability to minimize key
performance metrics such as average waiting time and turnaround time highlights its
limitations. Despite these drawbacks, FCFS remains an essential concept for understanding
CPU scheduling, providing a baseline against which more advanced algorithms like Shortest
Job Next (SJN) and Round Robin (RR) can be compared. This paper discusses the
characteristics, advantages, disadvantages, and practical implications of FCFS, shedding light
on its relevance in both academic and practical scenarios.
3
INTRODUCTION
The First-Come, First-Served (FCFS) CPU Scheduling Algorithm is one of the
earliest and simplest methods designed to manage the execution of processes in
operating systems. Drawing inspiration from real-world queue management,
FCFS operates on a first-in, first-out basis, ensuring that the process arriving first
is executed first. This non-preemptive scheduling approach promotes fairness, as
every process is served in the exact order of arrival without interruption.
However, while straightforward in concept and implementation, the algorithm
reveals limitations when applied to diverse workload scenarios.
Key drawbacks, such as the convoy effect, can lead to prolonged waiting times
for shorter processes when a long process occupies the CPU. Furthermore, the
inability to optimize metrics such as waiting time, turnaround time, and response
time makes it less efficient compared to more advanced scheduling algorithms.
Despite these challenges, FCFS remains a foundational topic in the study of
operating systems, providing essential insights into scheduling mechanics and
serving as a baseline for evaluating other algorithms like Shortest Job Next (SJN)
and Round Robin (RR).
This introduction provides a comprehensive overview of FCFS and sets the stage
for deeper discussions into its mechanics, advantages, disadvantages, and use
cases.
4
Characteristics OF FCFS CPU
Scheduling Algorithm
1. Non-Preemptive Scheduling:
In FCFS, processes are executed without interruption. Once a process starts
execution, it runs to completion, regardless of whether other processes with
shorter burst times are waiting.
3. Simplicity:
FCFS is one of the simplest scheduling algorithms to implement, as it requires
minimal computation and follows a straightforward queue-based structure.
4. Fairness:
Every process is treated equally by being executed in the order of arrival. No
process can bypass another, which makes it fair in terms of scheduling.
5. Convoy Effect:
FCFS suffers from the convoy effect, where one long process delays all
subsequent processes, leading to inefficiencies in average waiting and
turnaround times.
6. Lack of Optimization:
FCFS does not optimize key scheduling criteria such as waiting time, turnaround
time, or response time. This can lead to poor performance, especially in cases of
varying process burst times.
7. Sequential Processing:
Processes are handled one at a time. There is no simultaneous or parallel
execution in FCFS scheduling.
8. Susceptibility to Starvation:
While FCFS does not typically cause starvation under normal circumstances,
processes with shorter burst times may experience delays when they are
queued behind a long-running process.
5
Key Metrics for FCFS CPU Scheduling
Algorithm
1. Completion Time (CT):
Definition: The time at which a process completes its execution.
How to Calculate: Add the burst time of each process in the order of execution.
Note: Burst time is provided as input and does not change during the execution.
6
5. Average Waiting Time (AWT):
Definition: The average of the waiting times of all processes.
Example:
Step-by-step execution:
7
Final Metrics:
8
Advantages of FCFS CPU Scheduling
Algorithm
1. Simplicity:
FCFS is the simplest CPU scheduling algorithm to understand and implement. It
uses a straightforward first-in, first-out (FIFO) approach, making it easy to
manage.
2. Fairness:
Processes are executed in the exact order of their arrival, ensuring no process is
skipped or given undue priority over others.
3. Predictable Behavior:
Since processes are scheduled based on arrival time, the execution order is
predictable, which can help in systems where task predictability is important.
4. Low Overhead:
FCFS has minimal scheduling overhead because it doesn't require complex
calculations or priority handling, making it suitable for simple systems.
5. No Starvation:
Every process eventually gets executed in FCFS, eliminating the risk of starvation
(where a process is indefinitely delayed from execution).
9
disadvantages of FCFS CPU
Scheduling Algorithm
1. Convoy Effect:
A long-running process at the front of the queue can delay all the shorter
processes behind it. This leads to inefficiency and can increase average waiting
and turnaround times.
4. No Prioritization:
FCFS does not allow for prioritization. Processes are treated equally, regardless
of their urgency or importance, which may not be suitable for critical real-time
tasks.
6. Lack of Flexibility:
Being a non-preemptive algorithm, FCFS cannot accommodate processes that
need immediate attention or respond to dynamically changing workloads.
10
Conclusion
However, FCFS's limitations, such as the convoy effect and poor optimization of
average waiting and turnaround times, often make it unsuitable for modern,
dynamic computing environments where efficiency and responsiveness are
critical. It performs best in systems with predictable workloads, such as batch
processing systems, but struggles in scenarios with diverse or time-sensitive
tasks.
11
References
Tutorials Point - FCFS Scheduling Algorithm: This resource explains the basics of
FCFS, its implementation, and real-life examples.
Tutorials Point - Process Scheduling Algorithms: Covers FCFS along with other
popular scheduling algorithms for comparison.
12