
First-Come First-Served runs processes in arrival order without preemption—like a single checkout queue. Simple to implement, but long jobs can block short ones.
Waiting time = start time − arrival time for each process. Average waiting time is the mean across all processes in the schedule.
When burst times vary widely: a long early job creates convoy effect and high average wait. Round-robin or SJF often serve interactive systems better.
In operating systems, CPU scheduling determines the order in which processes are executed on the CPU. One of the simplest scheduling algorithms is First-Come First-Served (FCFS), where processes are executed in the order they arrive.
In this blog post, we will:
Consider the following processes:
| Process | Arrival Time | CPU Burst Time |
|---|---|---|
| P1 | 0 | 5 |
| P2 | 2 | 7 |
| P3 | 4 | 3 |
| P4 | 6 | 9 |
| P5 | 8 | 1 |
| P6 | 10 | 5 |
We will schedule them using FCFS.
Since FCFS follows the arrival order, the CPU executes processes as follows:
t=0 and runs for 5 units.
05t=2 but must wait until P1 finishes (t=5).
55 + 7 = 12t=4 but must wait until P2 finishes (t=12).
1212 + 3 = 15t=6 but must wait until P3 finishes (t=15).
1515 + 9 = 24t=8 but must wait until P4 finishes (t=24).
2424 + 1 = 25t=10 but must wait until P5 finishes (t=25).
2525 + 5 = 30The waiting time for a process is the time it spends waiting in the ready queue before execution.
Let’s compute it for each process:
| Process | Arrival Time | Start Time | Waiting Time |
|---|---|---|---|
| P1 | 0 | 0 | 0 - 0 = 0 |
| P2 | 2 | 5 | 5 - 2 = 3 |
| P3 | 4 | 12 | 12 - 4 = 8 |
| P4 | 6 | 15 | 15 - 6 = 9 |
| P5 | 8 | 24 | 24 - 8 = 16 |
| P6 | 10 | 25 | 25 - 10 = 15 |
Now, we compute:
The original question asks which statement is true based on the computed waiting times. The options were:
✅ Option 1 is correct because:
Try solving this yourself:
| Process | Arrival Time | Burst Time |
|---|---|---|
| A | 0 | 3 |
| B | 2 | 6 |
| C | 4 | 4 |
| D | 6 | 5 |
Compute:
A (0-3) → B (3-9) → C (9-13) → D (13-18)
03 - 2 = 19 - 4 = 513 - 6 = 7(0 + 1 + 5 + 7)/4 = 3.257 (for D)FCFS is straightforward but can lead to inefficiencies. Understanding how to compute waiting times helps in evaluating scheduling algorithms.