First-come, first-served scheduling

Also known as: FCFS

On this page 8

First-come, first-served scheduling (FCFS) is a non-preemptive CPU scheduling algorithm that runs ready processes strictly in the order they arrive in the ready queue, letting each one keep the processor until it finishes its CPU burst, blocks for I/O or voluntarily yields. In operating systems it is the simplest scheduling policy and serves as the baseline against which processes & scheduling designers measure more sophisticated algorithms.

FCFS is also called FIFO scheduling because the ready queue behaves as a first-in, first-out queue. Its appeal is simplicity and fairness by arrival; its weakness is that one long job can force many short jobs to wait, a pattern known as the convoy effect.

How FCFS scheduling works

FCFS maintains a single FIFO ready queue. When a process becomes ready, its process control block is appended to the tail of the queue. When the CPU becomes free, the dispatcher removes the process at the head of the queue and runs it. Because the policy is non-preemptive, the scheduler never interrupts a running process to give the CPU to another one.

A running process leaves the CPU only in three situations: it completes its burst, it issues a blocking I/O request, or it calls a yield primitive. A process that returns from I/O rejoins the tail of the queue, not its old position. The table below summarizes these transitions.

EventScheduler actionQueue effect
New process arrivesMark it readyAppend to the tail
Running process blocksDispatch the head processBlocked process leaves the queue
I/O completesMark the process readyAppend to the tail
Running process exitsDispatch the head processQueue shrinks by one
Timer interruptNo reschedulingNo change
Process events under FCFS

The implementation cost is minimal: enqueue and dequeue are constant-time operations, and the scheduler needs no estimates of burst length, no priorities and no time slice. Context switches occur only when a process stops running on its own, so switching overhead is the lowest of the common policies.

Measuring FCFS performance

FCFS performance depends heavily on arrival order, which is its defining weakness. Scheduling algorithms are compared with standard metrics: waiting time (time spent in the ready queue), turnaround time (from arrival to completion) and response time (from arrival to first run).

Consider three processes that arrive at time zero with CPU bursts of 20 ms, 4 ms and 2 ms. The table shows the result when the long process happens to arrive first.

ProcessBurst timeWaiting timeTurnaround time
P120 ms0 ms20 ms
P24 ms20 ms24 ms
P32 ms24 ms26 ms
Average8.67 ms14.67 ms23.33 ms
Long job first: P1, P2, P3

If the same processes arrive in the reverse order, P3 waits 0 ms, P2 waits 2 ms and P1 waits 6 ms, so the average waiting time falls to 2.67 ms. The workload is identical; only the order changed. This sensitivity to arrival order means FCFS gives highly variable and often poor average waiting times.

The convoy effect

The convoy effect occurs when one CPU-bound process holds the processor while many I/O-bound processes queue behind it. While they wait, the I/O devices sit idle. When the long process finally blocks, the short processes run their brief bursts quickly and return to I/O, leaving the CPU idle in turn.

The result is poor utilization of both CPU and devices, because the system alternates between phases in which only one resource is busy. Interactive programs suffer most, since their short bursts are delayed by unrelated long computations, producing sluggish response times.

FCFS compared with other scheduling algorithms

FCFS sits at one end of a spectrum of trade-offs between simplicity, throughput and responsiveness. The comparison below shows how it relates to the neighboring policies in the same topic.

AlgorithmPreemptiveMain strengthMain weakness
FCFSNoSimple, low overheadConvoy effect, poor average wait
Shortest job firstOptionalMinimal average waiting timeNeeds burst estimates, starvation
Round-robin schedulingYesGood response timeMore context switches
Priority schedulingOptionalExpresses importanceStarvation without aging
Multilevel feedback queueYesAdapts to process behaviorComplex tuning
FCFS and related CPU scheduling policies

Round-robin is essentially FCFS with preemption: it uses the same FIFO queue but limits each turn to a time slice. As the slice grows very large, round-robin degenerates into FCFS. Many multilevel feedback queues also use FCFS in their lowest-priority level for long batch jobs.

Where FCFS is still used

FCFS is rarely the main CPU scheduler of a modern general-purpose operating system, but it remains common inside larger designs and in systems where fairness by arrival matters more than responsiveness. The table lists typical uses and the reason each one fits.

ContextWhy FCFS fits
Batch processing systemsThroughput matters, interactivity does not
Real-time FIFO policyEqual-priority tasks run to completion predictably
Print and job queuesUsers expect arrival order
Lowest feedback queue levelLong jobs need little scheduling effort
Simple embedded systemsMinimal code and memory
Typical uses of FCFS ordering

In Linux, the SCHED_FIFO real-time policy applies FCFS within a single priority level: a task runs until it blocks, yields or is preempted by a higher-priority task. This shows a common pattern, in which FCFS breaks ties while another mechanism handles preemption between levels.

Limitations and common mistakes

  • Assuming FCFS is fair in outcome: it is fair only by arrival, and short jobs can wait disproportionately long.
  • Ignoring burst variance: workloads with a mix of very long and very short bursts produce the worst average waiting times.
  • Using it for interactive workloads: without preemption, one runaway process can monopolize the CPU until it blocks.
  • Confusing it with starvation-free scheduling in all cases: every ready process eventually runs only if each running process eventually releases the CPU.

Understanding it simply

First-come, first-served scheduling works like a single line at a bakery counter. Whoever arrives first is served first. Nobody can cut in, and the clerk finishes with one customer before calling the next.

The problem appears when someone at the front orders fifty items. Everyone behind them, even people buying one loaf, must wait. That is why computers rarely use this rule alone for programs people interact with.

Applied in practice

A research group runs a shared compute server that processes overnight batch jobs: data conversions, statistical models and report generation. Jobs are submitted throughout the evening and the queue manager runs them in submission order, one per CPU core, each until completion.

The setup works well because nobody waits interactively and total throughput matters most. One night, however, a researcher submits a simulation that takes nine hours on a core that also had forty small conversion jobs queued behind it. Those jobs, each needing about two minutes, finish the next morning instead of shortly after midnight. The administrator responds by adding a separate queue for short jobs, a practical fix for the convoy effect that keeps FCFS order within each queue.