Skip to main content

Disk scheduling with 100 cylinders

Short answer

Head at 43 moving upward; FCFS services in queue order: 303 cylinders; SSTF picks nearest: 120; LOOK goes up to 86 then reverses: 120; C-SCAN goes to end 99, jumps to 0, continues upward: 185; SCAN goes to end then reverses: 146 cylinders.

Suppose that a disk drive has 100 cylinders, numbered 0 to 99. The drive is currently serving a request at cylinder 43, and previous request was at cylinder 25. The queue of pending request, in FIFO order is: 86, 70, 13, 74, 48, 9, 22, 50, 30 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all pending requests for each of the following disk scheduling algorithms? a) First-come, First served b) Shortest Seek Time First c) Look d) C-Scan e) Scan

Disk: 100 cylinders (0 to 99), head at 43, previous request at 25, so the head is moving upward (towards 99). Queue (FIFO): 86, 70, 13, 74, 48, 9, 22, 50, 30.

a) FCFS

FCFS: service order (head at 43): 86, 70, 13, 74, 48, 9, 22, 50, 30

   43 -> 86    = 43
   86 -> 70    = 16
   70 -> 13    = 57
   13 -> 74    = 61
   74 -> 48    = 26
   48 -> 9     = 39
    9 -> 22    = 13
   22 -> 50    = 28
   50 -> 30    = 20
Total = 43 + 16 + 57 + 61 + 26 + 39 + 13 + 28 + 20 = 303

b) SSTF

After 50, the cylinders 30 and 70 are equally near (20); the one in the direction of travel (70) is chosen. SSTF: service order (head at 43): 48, 50, 70, 74, 86, 30, 22, 13, 9

   43 -> 48    = 5
   48 -> 50    = 2
   50 -> 70    = 20
   70 -> 74    = 4
   74 -> 86    = 12
   86 -> 30    = 56
   30 -> 22    = 8
   22 -> 13    = 9
   13 -> 9     = 4
Total = 5 + 2 + 20 + 4 + 12 + 56 + 8 + 9 + 4 = 120

c) LOOK (go up as far as the last request, then reverse)

LOOK: service order (head at 43): 48, 50, 70, 74, 86, 30, 22, 13, 9

   43 -> 48    = 5
   48 -> 50    = 2
   50 -> 70    = 20
   70 -> 74    = 4
   74 -> 86    = 12
   86 -> 30    = 56
   30 -> 22    = 8
   22 -> 13    = 9
   13 -> 9     = 4
Total = 5 + 2 + 20 + 4 + 12 + 56 + 8 + 9 + 4 = 120

d) C-SCAN (go to the end 99, jump to 0, continue upward)

C-SCAN: service order (head at 43): 48, 50, 70, 74, 86, 9, 13, 22, 30

   43 -> 48    = 5
   48 -> 50    = 2
   50 -> 70    = 20
   70 -> 74    = 4
   74 -> 86    = 12
   86 -> 99    = 13
   99 -> 0     = 99  (return jump)
    0 -> 9     = 9
    9 -> 13    = 4
   13 -> 22    = 9
   22 -> 30    = 8
Total = 5 + 2 + 20 + 4 + 12 + 13 + 99 + 9 + 4 + 9 + 8 = 185

e) SCAN (go to the end 99, reverse)

SCAN: service order (head at 43): 48, 50, 70, 74, 86, 30, 22, 13, 9

   43 -> 48    = 5
   48 -> 50    = 2
   50 -> 70    = 20
   70 -> 74    = 4
   74 -> 86    = 12
   86 -> 99    = 13
   99 -> 30    = 69
   30 -> 22    = 8
   22 -> 13    = 9
   13 -> 9     = 4
Total = 5 + 2 + 20 + 4 + 12 + 13 + 69 + 8 + 9 + 4 = 146

Summary

AlgorithmTotal head movement (cylinders)
a) FCFS303
b) SSTF120
c) LOOK120
d) C-SCAN185 (86 if the return sweep is not counted)
e) SCAN146

If the tie at cylinder 50 is broken the other way (30 first), SSTF would be 125.

Answer: FCFS 303, SSTF 120, LOOK 120, C-SCAN 185, SCAN 146 cylinders.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 6 questions →