Skip to main content

Disk scheduling, 1000 cylinders, head at 345

Short answer

Head at 345 moving toward 0; FIFO (FCFS) services in arrival order: 2013 tracks; SSTF selects the closest request: 1298 tracks; SCAN goes to cylinder 0 then reverses upward: 1219 tracks.

A disk with 1000 cylinders, numbered 0 to 999, compute the number of tracks the disk arm must move to satisfy all the requests in the disk queue. Assume the last request serviced was at track 345 and the head is moving towards track 0 (zero). The queue in FIFO order contains request for the following tracks: 123, 874, 693, 475, 105, 376 Perform the computation for the following scheduling algorithms: a) FIFO b) SSTF c) SCAN

Disk: 1000 cylinders (0 to 999). Head at 345, moving towards 0. Queue (FIFO): 123, 874, 693, 475, 105, 376.

a) FIFO

FIFO: service order (head at 345): 123, 874, 693, 475, 105, 376

  345 -> 123   = 222
  123 -> 874   = 751
  874 -> 693   = 181
  693 -> 475   = 218
  475 -> 105   = 370
  105 -> 376   = 271
Total = 222 + 751 + 181 + 218 + 370 + 271 = 2013

b) SSTF

SSTF: service order (head at 345): 376, 475, 693, 874, 123, 105

  345 -> 376   = 31
  376 -> 475   = 99
  475 -> 693   = 218
  693 -> 874   = 181
  874 -> 123   = 751
  123 -> 105   = 18
Total = 31 + 99 + 218 + 181 + 751 + 18 = 1298

c) SCAN (moving toward 0: go down to track 0, then reverse and go up)

SCAN: service order (head at 345): 123, 105, 376, 475, 693, 874

  345 -> 123   = 222
  123 -> 105   = 18
  105 -> 0     = 105
    0 -> 376   = 376
  376 -> 475   = 99
  475 -> 693   = 218
  693 -> 874   = 181
Total = 222 + 18 + 105 + 376 + 99 + 218 + 181 = 1219
AlgorithmTracks moved
FIFO2013
SSTF1298
SCAN1219

(If LOOK were used, the arm would turn back at 105 and the movement would be 1009.)

Answer: FIFO = 2013, SSTF = 1298, SCAN = 1219 tracks.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 6 questions →