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
Graph Traversals: Breadth-First Search (BFS) vs. Depth-First Search (DFS)
This content contrasts Breadth‑First Search (BFS) and Depth‑First Search (DFS), outlining their traversal order, complexity, and typical use cases.
- BFS uses a FIFO queue, visits nodes level by level (A→B→C→D→E→F); DFS uses a LIFO stack, dives deep (A→B→D→E→C→F).
- Both run in time; BFS may need (or ) space, while DFS typically uses stack depth.
- BFS guarantees the shortest path in unweighted graphs, suited for routing, web crawling, and level‑order serialization.
- DFS excels in memory‑limited, wide graphs and in tasks like topological sort and cycle detection, but deep recursion can cause stack overflow.
The Banker's Algorithm: Deadlock Avoidance in Operating Systems
The Banker's Algorithm is a deadlock‑avoidance method that keeps a system in a safe state by checking each resource request against the maximum declared needs of processes.
- Maintains Available, Max, Allocation, and Need matrices, where .
- The Safety Algorithm uses vectors Work and Finish to find an execution order; if all processes finish, the state is safe.
- The Resource‑Request Algorithm simulates allocation, runs the safety check, and commits only if the resulting state remains safe.
- Time complexity of the safety check is .
- In practice the algorithm is rarely used because processes must predeclare maximum needs and the algorithm’s overhead is high.
Differentiating Rotating Storage Media: Constant Linear Velocity (CLV) vs. Constant Angular Velocity (CAV)
Rotating storage media use either Constant Angular Velocity (CAV) or Constant Linear Velocity (CLV) to control the relationship between angular speed and linear speed on the disk.
- CAV: Fixed (e.g., 7200 RPM), rises with radius, sectors per track stay constant → lower outer‑track density, constant transfer rate, minimal seek latency.
- CLV: varies as to keep constant, giving uniform sector size, higher outer‑track capacity, but slower seeks due to motor speed changes.
- Zone Bit Recording (ZBR): Hybrid CAV that keeps constant while dividing the platter into zones with increasing sectors per track, boosting capacity and outer‑track throughput.
- Mechanical limits: Very high‑speed CLV would require inner‑edge RPM > 10 000, causing vibration and disc failure, prompting a shift to CAV or hybrid modes.
- Key formulas: and govern the trade‑offs between data density, transfer rate, and seek time.
