SSTF Disk Scheduling Worked Example: Total Head Movement for the Given Request Queue
Disk scheduling aims to reduce seek time by choosing a favorable service order among pending requests.2 In SSTF scheduling, the next request chosen is always the one with the minimum absolute distance from the current head position, which usually reduces total movement compared with FIFO service.2 However, SSTF may cause starvation for far-away requests under continuous load.
For this problem:
- Disk cylinders: to
- Current head position:
- Previous request:
- Pending queue in FIFO order:
Under SSTF, FIFO order is not preserved after selection; instead, at each step we choose the pending request with the smallest distance from the current head.2
The total head movement is computed as the sum of absolute cylinder differences:
where and each subsequent is the next request selected by SSTF.
Footnotes
-
SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS. ↩ ↩2 ↩3
-
Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward simulation approach. ↩ ↩2 ↩3 ↩4
-
Disk Scheduling Algorithms - GeeksforGeeks - Summarizes disk scheduling goals and highlights SSTF's starvation risk and fairness trade-offs. ↩
SSTF in Disk Scheduling with Example
Important Interpretation
The previous request at only indicates the recent direction of travel. In SSTF, the next request is still selected purely by minimum distance from the current head at .2
Footnotes
-
SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS. ↩
-
Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward simulation approach. ↩
Applying SSTF to the Given Queue
- 1Step 1
Current head position is . Pending requests are .
- 2Step 2
Distances are: to is , to is , to is , to is , to is , to is , to is , to is , and to is . The nearest is , so move cylinders.
Footnotes
-
Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward simulation approach. ↩
-
- 3Step 3
Remaining requests: . Distances from : to is , to is , to is , to is , to is , to is , to is , to is . The nearest is , so move .
- 4Step 4
Remaining requests: . Distances from : to is , to is , to is , to is , to is , to is , to is . The nearest is , so move .
- 5Step 5
Remaining requests: . Distances from : to is , to is , to is , to is , to is , to is . The nearest is , so move .
- 6Step 6
Remaining requests: . Distances from : to is , to is , to is , to is , to is . The nearest is , so move .
- 7Step 7
Remaining requests: . Distances from : to is , to is , to is , to is . The nearest is , so move .
- 8Step 8
Remaining requests: . Distances from : to is , to is , to is . The nearest is , so move .
- 9Step 9
Remaining requests: . Distances from : to is , to is . The nearest is , so move .
- 10Step 10
Only remains. Move from to , which is cylinders.
- 11Step 11
Total movement cylinders.
The SSTF service sequence is therefore:
The corresponding head movements are:
| From | To | Distance |
|---|---|---|
Thus,
So, the disk arm moves a total of cylinders to satisfy all pending requests using SSTF.2
Footnotes
-
SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS. ↩
-
Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward simulation approach. ↩
Head Movement Per SSTF Step
Cylinder distance traveled at each selection step
SSTF Service Order for This Problem
Move to 130
Step 1Nearest request to is , requiring cylinders of movement."
Move to 86
Step 2Nearest request to is , requiring cylinders."
Move to 913
Step 3After clearing nearby low cylinders, the nearest remaining request from is , requiring cylinders."
Move to 948
Step 4Nearest request from is , requiring cylinders."
Move to 1022
Step 5Nearest request from is , requiring cylinders."
Move to 1470
Step 6Nearest request from is , requiring cylinders."
Move to 1509
Step 7Nearest request from is , requiring cylinders."
Move to 1750
Step 8Nearest request from is , requiring cylinders."
Move to 1774
Step 9Final remaining request is , requiring cylinders."
Exam Strategy
In SSTF problems, do not follow the FIFO queue order. Recompute absolute distances from the current head after every move, because the nearest request changes dynamically.2
Footnotes
-
SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS. ↩
-
Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward simulation approach. ↩
Common Mistake
Do not force the head to keep moving in the same direction just because the previous request was at . Direction matters in SCAN-like algorithms, but SSTF chooses only the minimum current seek distance.2
Footnotes
-
SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS. ↩
-
Disk Scheduling Algorithms - GeeksforGeeks - Summarizes disk scheduling goals and highlights SSTF's starvation risk and fairness trade-offs. ↩
Concept Checks and Edge Cases
Starting sequence:
Total movement:
A useful interpretation is that SSTF greedily minimizes the next move, not necessarily the globally optimal total path.2 In this instance, it first clears the two nearby low-cylinder requests ( and ), then jumps to the closest remaining higher-cylinder cluster and continues locally from there. This local-choice behavior is characteristic of a greedy algorithm and explains both SSTF's efficiency and its fairness limitations.2
Therefore, the correct result for the given queue is:
Footnotes
-
Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward simulation approach. ↩ ↩2
-
Disk Scheduling Algorithms - GeeksforGeeks - Summarizes disk scheduling goals and highlights SSTF's starvation risk and fairness trade-offs. ↩ ↩2
Knowledge Check
In SSTF disk scheduling, what criterion determines the next request to be served?
Explore Related Topics
FIFO Branch-and-Bound Uses a Queue
FIFO Branch-and-Bound expands live nodes in the exact order they are generated, so it is implemented with a queue.
- A queue enforces first‑in‑first‑out, giving the algorithm a BFS‑like, level‑order traversal.
- LIFO Branch‑and‑Bound uses a stack and least‑cost Branch‑and‑Bound uses a priority queue.
- Bounding prunes unpromising nodes independently of the FIFO selection rule.
- Pseudocode: initialize , enqueue root, while dequeue front, generate children, enqueue survivors.
- The abstract answer is “queue,” not an array or other structure, even if an array may implement a queue.
Paging Addressing: Logical vs Physical Bits and Page Table Size
Round Robin Scheduling Analysis for Five Processes with Time Quantum 3 ms