What is FCFS Disk Scheduling?
What FCFS disk scheduling is, how it serves requests in arrival order, its seek-time trade-offs, with OS interview questions.
Expected Interview Answer
First-Come-First-Served (FCFS) disk scheduling services disk I/O requests in the exact order they arrive in the queue, moving the disk head to each requested cylinder in turn regardless of how far it has to travel.
FCFS is the simplest disk scheduling algorithm: there is no reordering, so the disk head simply seeks from its current position to the next request’s cylinder, then to the one after that, in strict arrival order. This makes FCFS trivially fair — no request can be starved since every request is eventually served in the order it arrived — and simple to implement with a plain queue. Its major weakness is total seek distance: if requests arrive interleaved across far-apart cylinders, the head oscillates back and forth across the disk, producing a much higher total seek time and lower throughput than algorithms that reorder requests by proximity, like SSTF or SCAN. FCFS is still used as a baseline for comparing other algorithms and in situations where request reordering is undesirable, such as when strict ordering guarantees matter more than raw throughput.
- Simplest possible disk scheduling algorithm to implement
- Guarantees no request is ever starved
- Useful baseline for comparing SSTF, SCAN, and other algorithms
- Predictable, order-preserving behavior when strict ordering matters
AI Mentor Explanation
FCFS disk scheduling is like a groundskeeper repairing pitch damage strictly in the order complaints were logged, even if that means walking from one end of the ground to the other and back again for consecutive complaints. No complaint is ever skipped or delayed indefinitely, since the queue is worked through in pure arrival order. But if complaints keep arriving from opposite ends of the ground, the groundskeeper wastes enormous time walking back and forth rather than fixing nearby patches together.
Step-by-Step Explanation
Step 1
Requests queued
Incoming disk I/O requests are appended to a queue in the order they arrive.
Step 2
Head at current position
The disk head starts at whatever cylinder it last serviced.
Step 3
Serve in order
The head seeks to the next queued request's cylinder, regardless of distance, and services it.
Step 4
Repeat
The process repeats for each subsequent request strictly in arrival order until the queue empties.
What Interviewer Expects
- Correct definition: requests served in pure arrival order
- Recognition that FCFS never starves a request
- Ability to explain why total seek time can be poor under scattered requests
- Comparison awareness against SSTF or SCAN when asked about trade-offs
Common Mistakes
- Confusing FCFS disk scheduling with FCFS CPU scheduling (different resource, same idea)
- Claiming FCFS minimizes seek time (it does not reorder at all)
- Forgetting FCFS guarantees fairness/no starvation
- Not being able to trace a simple seek-time example by hand
Best Answer (HR Friendly)
“FCFS disk scheduling just processes disk requests in the exact order they show up, with no cleverness about where the disk head currently is. It is completely fair since nothing waits forever, and it is very simple to implement, but it can waste a lot of time if requests keep jumping between far-apart parts of the disk instead of being grouped by location.”
Code Example
#include <stdio.h>
#include <stdlib.h>
int total_seek_fcfs(int requests[], int n, int head_start) {
int total = 0;
int head = head_start;
for (int i = 0; i < n; i++) {
total += abs(requests[i] - head); /* seek distance to next request */
head = requests[i]; /* head is now at this cylinder */
}
return total;
}
int main(void) {
int requests[] = { 98, 183, 37, 122, 14, 124, 65, 67 };
int n = sizeof(requests) / sizeof(requests[0]);
printf("Total seek time: %d\n", total_seek_fcfs(requests, n, 53));
return 0;
}Follow-up Questions
- How would you compute the total seek distance for a given FCFS request sequence?
- Why does FCFS generally have worse average seek time than SSTF?
- In what scenario might FCFS actually be preferable to a reordering algorithm?
- How does FCFS disk scheduling relate to FCFS CPU scheduling conceptually?
MCQ Practice
1. In FCFS disk scheduling, requests are served in what order?
FCFS makes no attempt to reorder requests by proximity or priority; it strictly follows arrival order.
2. What is the main advantage of FCFS disk scheduling?
FCFS is trivial to implement and every request is eventually served, but it does not optimize seek distance.
3. What is the main drawback of FCFS disk scheduling?
Because FCFS never reorders by location, the head can oscillate wildly across the disk, hurting total seek time.
Flash Cards
What does FCFS disk scheduling do? — Services disk requests in the exact order they arrived, with no reordering.
Does FCFS ever starve a request? — No — every request is eventually served in arrival order.
What is the main weakness of FCFS? — Poor total seek time when requests are scattered across the disk.
What is FCFS commonly used for besides direct scheduling? — As a baseline for comparing other disk scheduling algorithms like SSTF and SCAN.