CoursifyCoursify

SSTF Disk Scheduling Worked Example: Total Head Movement for the Given Request Queue

SSTF Disk Scheduling Worked Example: Total Head Movement for the Given Request Queue

Verified Sources
May 27, 2026

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: 00 to 49994999
  • Current head position: 143143
  • Previous request: 125125
  • Pending queue in FIFO order: 86,1470,913,1774,948,1509,1022,1750,13086, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

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:

Total movement=i=1nHiHi1\text{Total movement} = \sum_{i=1}^{n} |H_i - H_{i-1}|

where H0=143H_0 = 143 and each subsequent HiH_i is the next request selected by SSTF.

Footnotes

  1. SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS. 2 3

  2. Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward O(n2)O(n^2) simulation approach. 2 3 4

  3. 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 125125 only indicates the recent direction of travel. In SSTF, the next request is still selected purely by minimum distance from the current head at 143143.2

Footnotes

  1. SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS.

  2. Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward O(n2)O(n^2) simulation approach.

Applying SSTF to the Given Queue

  1. 1
    Step 1

    Current head position is 143143. Pending requests are 86,1470,913,1774,948,1509,1022,1750,13086, 1470, 913, 1774, 948, 1509, 1022, 1750, 130.

  2. 2
    Step 2

    Distances are: to 8686 is 5757, to 130130 is 1313, to 913913 is 770770, to 948948 is 805805, to 10221022 is 879879, to 14701470 is 13271327, to 15091509 is 13661366, to 17501750 is 16071607, and to 17741774 is 16311631. The nearest is 130130, so move 1313 cylinders.

    Footnotes

    1. Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward O(n2)O(n^2) simulation approach.

  3. 3
    Step 3

    Remaining requests: 86,1470,913,1774,948,1509,1022,175086, 1470, 913, 1774, 948, 1509, 1022, 1750. Distances from 130130: to 8686 is 4444, to 913913 is 783783, to 948948 is 818818, to 10221022 is 892892, to 14701470 is 13401340, to 15091509 is 13791379, to 17501750 is 16201620, to 17741774 is 16441644. The nearest is 8686, so move 4444.

  4. 4
    Step 4

    Remaining requests: 1470,913,1774,948,1509,1022,17501470, 913, 1774, 948, 1509, 1022, 1750. Distances from 8686: to 913913 is 827827, to 948948 is 862862, to 10221022 is 936936, to 14701470 is 13841384, to 15091509 is 14231423, to 17501750 is 16641664, to 17741774 is 16881688. The nearest is 913913, so move 827827.

  5. 5
    Step 5

    Remaining requests: 1470,1774,948,1509,1022,17501470, 1774, 948, 1509, 1022, 1750. Distances from 913913: to 948948 is 3535, to 10221022 is 109109, to 14701470 is 557557, to 15091509 is 596596, to 17501750 is 837837, to 17741774 is 861861. The nearest is 948948, so move 3535.

  6. 6
    Step 6

    Remaining requests: 1470,1774,1509,1022,17501470, 1774, 1509, 1022, 1750. Distances from 948948: to 10221022 is 7474, to 14701470 is 522522, to 15091509 is 561561, to 17501750 is 802802, to 17741774 is 826826. The nearest is 10221022, so move 7474.

  7. 7
    Step 7

    Remaining requests: 1470,1774,1509,17501470, 1774, 1509, 1750. Distances from 10221022: to 14701470 is 448448, to 15091509 is 487487, to 17501750 is 728728, to 17741774 is 752752. The nearest is 14701470, so move 448448.

  8. 8
    Step 8

    Remaining requests: 1774,1509,17501774, 1509, 1750. Distances from 14701470: to 15091509 is 3939, to 17501750 is 280280, to 17741774 is 304304. The nearest is 15091509, so move 3939.

  9. 9
    Step 9

    Remaining requests: 1774,17501774, 1750. Distances from 15091509: to 17501750 is 241241, to 17741774 is 265265. The nearest is 17501750, so move 241241.

  10. 10
    Step 10

    Only 17741774 remains. Move from 17501750 to 17741774, which is 2424 cylinders.

  11. 11
    Step 11

    Total movement =13+44+827+35+74+448+39+241+24=1745= 13 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24 = 1745 cylinders.

The SSTF service sequence is therefore:

1431308691394810221470150917501774143 \rightarrow 130 \rightarrow 86 \rightarrow 913 \rightarrow 948 \rightarrow 1022 \rightarrow 1470 \rightarrow 1509 \rightarrow 1750 \rightarrow 1774

The corresponding head movements are:

FromToDistance
1431431301301313
13013086864444
8686913913827827
9139139489483535
948948102210227474
1022102214701470448448
14701470150915093939
1509150917501750241241
17501750177417742424

Thus,

13+44+827+35+74+448+39+241+24=174513 + 44 + 827 + 35 + 74 + 448 + 39 + 241 + 24 = 1745

So, the disk arm moves a total of 17451745 cylinders to satisfy all pending requests using SSTF.2

Footnotes

  1. SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS.

  2. Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward O(n2)O(n^2) simulation approach.

Head Movement Per SSTF Step

Cylinder distance traveled at each selection step

SSTF Service Order for This Problem

Move to 130

Step 1

Nearest request to 143143 is 130130, requiring 1313 cylinders of movement."

Move to 86

Step 2

Nearest request to 130130 is 8686, requiring 4444 cylinders."

Move to 913

Step 3

After clearing nearby low cylinders, the nearest remaining request from 8686 is 913913, requiring 827827 cylinders."

Move to 948

Step 4

Nearest request from 913913 is 948948, requiring 3535 cylinders."

Move to 1022

Step 5

Nearest request from 948948 is 10221022, requiring 7474 cylinders."

Move to 1470

Step 6

Nearest request from 10221022 is 14701470, requiring 448448 cylinders."

Move to 1509

Step 7

Nearest request from 14701470 is 15091509, requiring 3939 cylinders."

Move to 1750

Step 8

Nearest request from 15091509 is 17501750, requiring 241241 cylinders."

Move to 1774

Step 9

Final remaining request is 17741774, requiring 2424 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

  1. SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS.

  2. Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward O(n2)O(n^2) simulation approach.

Common Mistake

Do not force the head to keep moving in the same direction just because the previous request was at 125125. Direction matters in SCAN-like algorithms, but SSTF chooses only the minimum current seek distance.2

Footnotes

  1. SSTF Algorithm | Disk Scheduling Algorithms - Explains SSTF as serving the request with the shortest seek time and contrasts it with FCFS.

  2. 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: 1431308691394810221470150917501774143 \rightarrow 130 \rightarrow 86 \rightarrow 913 \rightarrow 948 \rightarrow 1022 \rightarrow 1470 \rightarrow 1509 \rightarrow 1750 \rightarrow 1774

Total movement:

143130+13086+86913+913948+9481022+10221470+14701509+15091750+17501774=1745|143-130|+|130-86|+|86-913|+|913-948|+|948-1022|+|1022-1470|+|1470-1509|+|1509-1750|+|1750-1774|=1745

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 (130130 and 8686), 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:

1745 cylinders\boxed{1745 \text{ cylinders}}

Footnotes

  1. Program for SSTF Disk Scheduling Algorithm - GeeksforGeeks - Provides the SSTF procedure, formula style examples, and notes a straightforward O(n2)O(n^2) simulation approach. 2

  2. Disk Scheduling Algorithms - GeeksforGeeks - Summarizes disk scheduling goals and highlights SSTF's starvation risk and fairness trade-offs. 2

Knowledge Check

Question 1 of 4
Q1Single choice

In SSTF disk scheduling, what criterion determines the next request to be served?

Explore Related Topics

1

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 O(V+E)O(V+E) time; BFS may need O(V)O(V) (or O(bd)O(b^d)) space, while DFS typically uses O(d)O(d) 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.
2

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 Need[i][j]=Max[i][j]Allocation[i][j]\text{Need}[i][j]=\text{Max}[i][j]-\text{Allocation}[i][j].
  • 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 O(m×n2)O(m \times n^{2}).
  • In practice the algorithm is rarely used because processes must predeclare maximum needs and the algorithm’s overhead is high.
3

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 ω\omega and linear speed vv on the disk.

  • CAV: Fixed ω\omega (e.g., 7200 RPM), vv rises with radius, sectors per track stay constant → lower outer‑track density, constant transfer rate, minimal seek latency.
  • CLV: ω\omega varies as ω(r)=v/r\omega(r)=v/r to keep vv 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 ω\omega 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: v=ωrv=\omega r and ω(r)=vr\omega(r)=\dfrac{v}{r} govern the trade‑offs between data density, transfer rate, and seek time.
Chat with Kiro