First Come First Served (FCFS) Scheduling

The Simplest Possible Scheduling Rule

First Come First Served (FCFS) runs processes in exactly the order they arrive, with no other consideration at all - the process that has been waiting longest always runs next, like a simple, single-line queue.

A Worked Example

Process   Arrival Time   Burst Time (CPU time needed)
P1        0              8
P2        1              4
P3        2              9

Execution order (FCFS): P1 -> P2 -> P3

Timeline:
|---- P1 (0-8) ----|-- P2 (8-12) --|------ P3 (12-21) ------|

Waiting time:
P1: 0 (starts immediately)
P2: 8 - 1 = 7
P3: 12 - 2 = 10

The Convoy Effect: FCFS's Main Weakness

If a long process arrives first, every shorter process behind it must wait for that entire long process to finish - even though, individually, those short processes could have completed far more quickly if scheduled first. This pileup of short processes behind one long one is called the convoy effect.

Why FCFS Is Still Worth Understanding

Despite the convoy effect, FCFS is simple, fair in the sense of "first arrived, first served," and easy to implement correctly - qualities that make it a useful conceptual baseline for comparing every other scheduling algorithm covered in this section against.

A Key Property: FCFS Is Non-Preemptive

Once a process starts running under FCFS, it runs to completion (or until it needs to wait for I/O) - it is never interrupted just to let another process take a turn. This non-preemptive nature is exactly what allows the convoy effect to happen in the first place.

Written by Lorens Mishra

Software Engineer Notes Management System Administrator

Discussion

0 comments
Sign in to join the discussion.

No comments yet. Be the first to say something.