FCFS Scheduling: First Come, First Served
First Come, First Served (FCFS), also called FIFO, gives the CPU to the process that arrived earliest among the ready work. Once a process starts, it keeps the CPU until its burst finishes.
The rule
A new arrival joins the waiting order. Its burst length does not let it move ahead of an earlier arrival. When arrivals are equal, this simulator uses input order to break the tie.
Worked example
| Process | Arrival | Burst |
|---|---|---|
| P1 | 0 | 7 |
| P2 | 1 | 3 |
| P3 | 2 | 1 |
One CPU · One burst per process · No I/O · Dispatch cost 0. Times are abstract units.
P1 starts at 0. P2 arrives at 1 and P3 at 2; these arrivals do not interrupt the selected job. At 7, P2 runs before P3 because its arrival is earlier.
The full CPU trace is P1 [0, 7), P2 [7, 10), P3 [10, 11). P3 needs 1 CPU unit but first runs at 10.
Arrival order decides. P3 arrives at 2, then waits behind earlier work until 10. Its burst is 1.
- P1: [0, 7)
- P2: [7, 10)
- P3: [10, 11)
Calculate the result
| Process | Completion | Waiting | Turnaround | Response |
|---|---|---|---|---|
| P1 | 7 | 0 | 7 | 0 |
| P2 | 10 | 6 | 9 | 6 |
| P3 | 11 | 8 | 9 | 8 |
P3: turnaround = 11 − 2 = 9. Waiting = 9 − 1 = 8. First response = 10 − 2 = 8.
Waiting and first response coincide for a nonpreempted process; interrupted work can wait again after its first turn.
Mean waiting = (0 + 6 + 8) / 3 ≈ 4.667 units. Mean response ≈ 4.667 units.
Why the convoy effect matters
FCFS gives a simple, predictable order and does not need burst length to choose who runs next. Its tradeoff appears when a long job is near the front: later short jobs wait behind it even though they would finish quickly. This is the convoy effect shown here.
Waiting and response happen to be equal in this nonpreemptive example because every process waits once before starting, then runs to completion. That equality does not hold for every scheduling policy.