Disk Scheduling Algorithms: FCFS, SSTF, SCAN and LOOK with a Full Worked Comparison

Work one disk queue through six scheduling algorithms, compare every head movement, and learn exactly when endpoints, direction and circular jumps matter.

KnowledgeGate Team

Exam prep & CS education

Updated 3 Dec 20266 min read
Disk Scheduling Algorithms: FCFS, SSTF, SCAN and LOOK with a Full Worked Comparison

A locally greedy disk policy can lose to a directional sweep even when both start at the same head. Use cylinders 0 to 299, head 125, and nine requests to derive FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK from one fresh workload. Every endpoint and circular return counts, so each total can be checked from the written path.

1. Disk Scheduling: Separate Service Order from Physical Movement

A pending request names a cylinder. A policy chooses the next request, while total head movement adds the absolute distance between every consecutive position. For a route x0, x1, ..., xk, the movement is the sum of |xi - xi-1|. Cylinders measure distance here, not time.

Seek time concerns head movement on a rotating disk. Rotational latency waits for the requested sector, and transfer time moves the data. A question may supply a conversion model, but a cylinder total alone does not establish complete device latency. SSDs do not use this moving-head model.

Use Disk Scheduling in Operating Systems: 6 Algorithms with Worked Examples for the familiar head-53, eight-request benchmark. Change the disk range, head and every request to test a different question: which decision rule wins when a compact high-side cluster competes with two distant low requests?

2. Fix the Queue, Direction and Counting Convention

Use cylinders 0 to 299, current head 125, previous head 110, and queue [16, 91, 150, 275, 31, 203, 127, 118, 240]. Movement from 110 to 125 makes the initial sweep upward. All nine requests are pending before service begins.

Sorted around the head, the lower partition is [16, 31, 91, 118] and the upper partition is [127, 150, 203, 240, 275]. Cylinders 0 and 299 are physical endpoints, not requests. SCAN and C-SCAN visit endpoints under this convention. LOOK and C-LOOK stop or wrap at request extremes. Circular returns count as movement.

Algorithm

Selection rule

Direction needed

Endpoint used

Circular return

FCFS

Arrival order

No

No

No

SSTF

Nearest pending request

No

No

No

SCAN

Sweep, reach endpoint, reverse

Yes

Yes

No

C-SCAN

Sweep, reach endpoint, wrap

Yes

Yes

Yes

LOOK

Sweep to last request, reverse

Yes

No

No

C-LOOK

Sweep to last request, wrap

Yes

No

Yes

3. FCFS and SSTF: Derive Two Different Local Decisions

FCFS preserves the queue exactly:

125 -> 16 -> 91 -> 150 -> 275 -> 31 -> 203 -> 127 -> 118 -> 240

Its movements are 109 + 75 + 59 + 125 + 244 + 172 + 76 + 9 + 122 = 991 cylinders. The average is 991 / 9 = 110.11 cylinders per request. The two large reversals, 275 -> 31 and 31 -> 203, dominate the result.

SSTF recomputes after every service:

125 -> 127 -> 118 -> 91 -> 150 -> 203 -> 240 -> 275 -> 31 -> 16

The movement is 2 + 9 + 27 + 59 + 53 + 37 + 35 + 244 + 15 = 481, averaging 481 / 9 = 53.44. At head 91, request 150 is 59 cylinders away and request 31 is 60 away, so the high cluster wins by one cylinder. That local choice eventually leaves a 275 -> 31 jump.

SSTF is lower than FCFS here, but it is neither globally optimal nor starvation-free. Use FCFS and SSTF Disk Scheduling: Worked Examples and Exam Traps for tie-breaking, timed arrivals and the continuing-arrival starvation case. Here every request is already pending, so only the policy changes.

4. SCAN Versus LOOK: Measure the Endpoint Cost

SCAN and LOOK head paths show endpoint travel and the 48-cylinder saving from LOOK.

Upward SCAN services the high partition, reaches 299, then reverses through the low partition:

125 -> 127 -> 150 -> 203 -> 240 -> 275 -> 299 -> 118 -> 91 -> 31 -> 16

The leg sum is 2 + 23 + 53 + 37 + 35 + 24 + 181 + 27 + 60 + 15 = 457. A faster geometric check is (299 - 125) + (299 - 16) = 174 + 283 = 457. Endpoint 299 contributes movement without becoming a tenth request.

LOOK reverses at the highest pending request, 275:

125 -> 127 -> 150 -> 203 -> 240 -> 275 -> 118 -> 91 -> 31 -> 16

Its movement is (275 - 125) + (275 - 16) = 150 + 259 = 409 cylinders, or 45.44 per request. LOOK saves 457 - 409 = 48 cylinders because SCAN travels from 275 to 299 and crosses that same 24-cylinder span again after reversing.

5. C-SCAN Versus C-LOOK: Count the Circular Return

Upward C-SCAN reaches 299, returns physically to 0, and then services the low partition upward:

125 -> 127 -> 150 -> 203 -> 240 -> 275 -> 299 -> 0 -> 16 -> 31 -> 91 -> 118

Its total is (299 - 125) + (299 - 0) + (118 - 0) = 174 + 299 + 118 = 591 cylinders. The average is 65.67. The return 299 -> 0 contributes 299 even though no request is serviced on it.

C-LOOK replaces both physical endpoints with request extremes:

125 -> 127 -> 150 -> 203 -> 240 -> 275 -> 16 -> 31 -> 91 -> 118

The total is (275 - 125) + (275 - 16) + (118 - 16) = 150 + 259 + 102 = 511, averaging 56.78. C-LOOK saves 80 cylinders against C-SCAN here. Use SCAN and C-SCAN Algorithms: Worked Example, Differences and Exam Traps for endpoint rules and a reversed-direction check on the classic head-53 queue. These nine requests instead keep all six policies on one comparison table.

6. Compare All Six Totals and Convert One Seek-Cost Model

Comparison table of six disk scheduling movements, averages, and illustrative model times.

Use the supplied illustrative model time = 0.25 ms x movement + 1.5 ms x serviced requests. With nine requests, the fixed service component is 13.5 ms. This model deliberately ignores rotational and transfer variation.

Algorithm

Movement

Average per request

Illustrative model time

FCFS

991

110.11

261.25 ms

SSTF

481

53.44

133.75 ms

SCAN

457

50.78

127.75 ms

C-SCAN

591

65.67

161.25 ms

LOOK

409

45.44

115.75 ms

C-LOOK

511

56.78

141.25 ms

LOOK is lowest on this snapshot. The result is workload-specific, not a universal ranking. SSTF loses to both reversing sweeps because its nearest-neighbour choices consume the high cluster before forcing the 244-cylinder jump from 275 to 31. Circular policies travel farther here because their reset is counted.

7. Disk Scheduling Traps: Correct the Rule Before the Arithmetic

  • Queue order versus sorted order: FCFS keeps arrival order; only the sweep policies sort by direction.

  • Initial direction: Previous head 110 and current head 125 imply an upward sweep. Without direction, SCAN-family totals are underdetermined.

  • Endpoint versus request extreme: SCAN reaches 299; LOOK reverses at 275. Treating 275 as the disk end changes the algorithm.

  • Circular return: Count 299 to 0 for C-SCAN and 275 to 16 for C-LOOK unless the question explicitly excludes the return.

  • Movement route versus service order: Endpoints may appear in a route but never increase the nine-request denominator.

  • Cylinder count versus latency: Convert only with a supplied model. Movement alone is not total access time.

  • Policy ranking: A lower total on one queue does not prove fairness, starvation freedom or universal optimality.

8. Reconstruct the Comparison and Choose the Next Study Step

Hide the paths and rebuild them from head 125, previous head 110, range 0 to 299, and queue [16, 91, 150, 275, 31, 203, 127, 118, 240]. The check sequence in algorithm order is 991, 481, 457, 591, 409, 511. Explain in one sentence why SSTF loses to SCAN here despite choosing the nearest request at every step.

Use GATE CS Exam Preparation to place disk scheduling beside file systems, memory and CPU scheduling. For a structured core-CS route, continue with Zero to Hero Complete CS Course. Recalculate the six averages before applying any time conversion.