FCFS

First-Come, First-Served (FCFS) Scheduling

Definition: FCFS is the simplest CPU scheduling algorithm where the process that arrives first in the ready queue is scheduled first.

Key Features:

  • Queue Type: FIFO (First In, First Out)
  • Type: Non-preemptive
  • Execution Rule: The CPU is assigned to the process at the head of the queue.
  • Drawback: Convoy effect — short processes may wait long times behind longer ones, causing low CPU and device utilization.
  • Waiting Time: Can be high and varies if burst times differ significantly.

Gantt Chart Example

Given:

ProcessArrival TimeBurst Time
P105
P213
P328
P436

Assumption

  • All arrive in order: P1 → P2 → P3 → P4
  • FCFS ignores arrival time if they’re queued.

Gantt Chart

  gantt
    title FCFS Process Scheduling
    dateFormat X
    axisFormat %s

    section Process Execution
    P1 (5)    :p1, 0, 5
    P2 (3)    :p2, 5, 8
    P3 (8)    :p3, 8, 16
    P4 (6)    :p4, 16, 22

Calculations

ProcessArrival TimeBurst TimeStart TimeCompletion TimeWaiting TimeTurnaround Time
P1050505
P2135847
P328816614
P43616221319

Averages

  • Average Waiting Time = (0 + 4 + 6 + 13) / 4 = 5.75
  • Average Turnaround Time = (5 + 7 + 14 + 19) / 4 = 11.25

This demonstrates how FCFS can lead to high waiting times especially when short processes follow long ones.

Last updated on