Q6Operating System
Question
Describe the different disk scheduling algorithms (FCFS, SSTF, SCAN).
Answer
FCFS, SSTF, and SCAN are disk scheduling algorithms that order I/O requests to minimize disk head movement and reduce access times.
Disk scheduling algorithms order the service of disk I/O requests to minimize seek time. Consider head initially at cylinder 53 and pending requests: 98, 183, 37, 122, 14, 124, 65, 67.
Requests are serviced in arrival order: 53→98→183→37→122→14→124→65→67. Total head movement = 45+85+146+85+108+110+59+2 = 640 cylinders. Advantage: Simple and fair, no starvation. Disadvantage: Inefficient with high seek time; the arm moves back and forth across the disk.
At each step, service the request nearest to the current head position: 53→65→67→37→14→98→122→124→183. Total movement = 12+2+30+23+84+24+2+59 = 236 cylinders. Advantage: Much better than FCFS; reduces average seek time significantly. Disadvantage: Can cause starvation for requests far from the current head position; not optimal.
The head moves in one direction (say, toward higher cylinders), services all requests in its path, reaches the end (or last request), then reverses direction. Starting at 53 moving up: 53→65→67→98→122→124→183→(reverse)→37→14. Total movement = 130+169 = 299 cylinders (roughly). Advantage: Efficient, no starvation, more uniform service. Disadvantage: Processes that just missed the head must wait for a full sweep.
C-SCAN (Circular SCAN) improves on SCAN by always sweeping in one direction and jumping back to the beginning, providing more uniform wait times. LOOK and C-LOOK are practical variants that don't go to disk ends but only to the last request in each direction. Modern OS typically use C-LOOK or deadline schedulers.