Skip to content

First Come, First Served (FCFS) Scheduling

Introduction

First Come, First Served (FCFS) is the simplest CPU scheduling algorithm, where the process that arrives first is executed first. It follows the First-In-First-Out (FIFO) approach, meaning that the CPU executes processes in the order of their arrival without preemption.


How FCFS Scheduling Works

  1. Processes enter the ready queue in the order of their arrival.
  2. The CPU is assigned to the first process, and it runs until completion.
  3. Once the first process completes, the CPU is assigned to the next process.
  4. The cycle continues until all processes are executed.

FCFS is a non-preemptive scheduling algorithm, meaning once a process starts executing, it cannot be interrupted until it finishes.


Example of FCFS Scheduling

Let’s consider three processes with their arrival time and burst time.

ProcessArrival Time (AT)Burst Time (BT)
P10 ms5 ms
P22 ms3 ms
P34 ms8 ms

Step-by-Step Execution

  1. P1 arrives at 0 ms and starts execution immediately.
  2. P1 completes at 5 ms, and P2 starts execution.
  3. P2 completes at 8 ms, and P3 starts execution.
  4. P3 completes at 16 ms.

Gantt Chart for FCFS Execution

CopyEdit| P1 | P1 | P1 | P1 | P1 | P2 | P2 | P2 | P3 | P3 | P3 | P3 | P3 | P3 | P3 | P3 |
0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16

Calculation of Turnaround Time (TAT) & Waiting Time (WT)

ProcessArrival Time (AT)Burst Time (BT)Completion Time (CT)Turnaround Time (TAT) = CT – ATWaiting Time (WT) = TAT – BT
P10 ms5 ms5 ms5 ms0 ms
P22 ms3 ms8 ms6 ms3 ms
P34 ms8 ms16 ms12 ms4 ms

Advantages of FCFS Scheduling

Simple and easy to implement – No complex decision-making required.
Fair scheduling – Every process gets CPU time in the order of arrival.
Works well for batch systems where processes are executed sequentially.


Disadvantages of FCFS Scheduling

Poor response time for short processes – If a long process arrives first, smaller processes must wait.
Convoy Effect – A long process delays all shorter processes, leading to inefficiency.
Non-preemptive – If a high-priority process arrives, it must wait in line.


When to Use FCFS Scheduling

  • Suitable for batch processing systems where process order is not critical.
  • Works well when all processes have similar burst times to avoid long waiting times.
  • Not ideal for interactive systems where quick response times are required.

Conclusion

FCFS is fair and simple, but it is inefficient for modern, multitasking environments. It suffers from long waiting times due to the convoy effect, making it unsuitable for real-time systems. However, it is still useful in scenarios where process execution order is not critical.