📝 SCAN scheduling in Disk Scheduling (9 MCQs)
Elevator-Style Movement Across Disk Cylinders
SCAN is a disk-scheduling algorithm in which the disk head moves in one direction, servicing requests along its path until it reaches the end of the disk. It then reverses direction and services requests encountered during the return sweep. The operating system uses this elevator-like movement to organise pending disk operations and reduce unnecessary head movement compared with arbitrary request ordering.
Why Directional Sweeps Improve Request Distribution
SSTF can repeatedly favour nearby cylinders and leave distant requests waiting for long periods. SCAN reduces this risk by moving systematically across the disk rather than selecting only the nearest request. Requests encountered along a sweep receive service in physical order. However, requests arriving just after the head passes their locations may wait until the next sweep.
Directional Scanning and Head Reversal
The scheduler maintains the current head position and movement direction. It selects pending requests in the direction of travel, ordered by cylinder position. When the head reaches the physical disk boundary, it reverses direction and begins servicing requests on the opposite side. The scheduler continues alternating sweeps while requests remain pending.
Servicing Requests During an Upward Sweep
Consider a disk with cylinders 0 through 199. The head starts at 50 and moves upward, with requests at 82, 140, and 170, plus a request at 43. SCAN services 82, 140, and 170, continues to cylinder 199, then reverses to service 43.
Predictable Service and Boundary Travel Overhead
SCAN provides more uniform waiting behaviour than SSTF under many workloads and reduces indefinite preference for nearby requests. However, it may travel to the physical boundary even when no request exists near that location. Requests arriving behind the head wait for another sweep. Performance depends on disk geometry, direction, request distribution, and workload intensity.
Common Confusions Between SCAN and LOOK
'SCAN reverses at the last pending request' is incorrect because it normally continues to the disk boundary. 'SCAN services requests in both directions simultaneously' is incorrect because the head moves in one direction at a time. 'SCAN completely eliminates waiting-time variation' is incorrect because request positions and arrival times still affect service delays.
Exam Focus: Boundary Reversal and Head Movement
Identify the disk boundaries, starting cylinder, and initial direction before arranging requests. Service cylinders in directional order, continue to the appropriate boundary, and then reverse. Calculate total movement using every segment, including travel to the boundary. Compare SCAN with LOOK and explain why SCAN can travel through cylinders containing no pending requests.
Key Terms of SCAN Scheduling
- SCAN - Services requests through directional sweeps.
- Elevator algorithm - Another name for SCAN.
- Disk boundary - End of the cylinder range.
- Direction - Current head movement orientation.
- Head reversal - Change in movement direction.
- Seek movement - Distance travelled by the head.
📝 All SCAN scheduling in Disk Scheduling MCQs
Q1. What is the primary characteristic of the SCAN disk‑scheduling algorithm?
📖 Explanation: The SCAN algorithm, often called the elevator algorithm, moves the head in one direction, servicing all pending requests it encounters, then reverses at the outer or inner edge of the disk. This matches option B. Option A describes FCFS, which does not reorder requests. Option C describes C‑SCAN, which jumps back without servicing on the return. Option D describes SSTF, which chooses the nearest request. SCAN’s systematic sweep reduces overall seek time in typical hard‑disk workloads.
Q2. Why does the SCAN algorithm typically produce less variance in request waiting times than FCFS?
📖 Explanation: SCAN creates a predictable head‑movement pattern: the arm travels from one end of the disk to the other, serving every request encountered. This regular motion prevents a request from waiting an unusually long time, which can happen under FCFS when a large request arrives early and blocks later ones. Option C captures this effect. Option A describes SSTF, not SCAN. Option B mentions rotational latency but does not explain variance. Option D is inaccurate because SCAN does not ignore order; it follows a defined sweep.
Q3. How does the reversal of direction in the SCAN algorithm affect the average seek time?
📖 Explanation: When SCAN reaches the extreme cylinder, the head must travel back across the entire range before servicing requests on the opposite side. This extra travel to the end (often an empty region) raises the average distance the head moves per request, but it also ensures that no request is ignored indefinitely. Option A describes this trade‑off. Option B is false because the head still visits both extremes. Option C misstates the algorithm’s behavior; SCAN does not skip cylinders. Option D is incorrect because reversal clearly changes the distance traveled.
Q4. A disk has pending requests at cylinders 55, 58, 18, 90, 150, and 38. The head is currently at cylinder 50 and is moving outward. Assuming the maximum cylinder number is 200, what total head movement will SCAN produce?
📖 Explanation: First the head moves from 50 to 55 (+5), then to 58 (+3), 90 (+32), and 150 (+60). It continues to the outer limit at 200 (+50) before reversing. On the return it travels to 38 (+162) and finally to 18 (+20). Summing these distances gives cylinders. Option B matches this total. The other options result from omitting one of the segments or mis‑ordering the requests, which would not follow SCAN’s outward‑then‑inward sweep.
Q5. Given an initial head position of 50 moving outward, and pending requests at cylinders 10, 22, 38, 43, 55, 73, 84, and 95, what is the average seek distance per request under SCAN (max cylinder 200)?
📖 Explanation: The SCAN order outward is 55, 73, 84, 95, then to 200, and back to 43, 38, 22, 10. Head movements are , , , , , , , , and . Adding them yields a total of cylinders. Dividing by the eight requests gives an average of cylinders. Option A reflects this calculation. The other choices arise from incorrect totals or dividing by the wrong number of requests.
Q6. A system currently uses SCAN for disk I/O. If it switches to C‑SCAN, which of the following is the most likely effect on overall throughput?
📖 Explanation: C‑SCAN always returns the head to the beginning of the disk without servicing requests on the return trip, creating a consistent, one‑direction sweep. This eliminates the extra back‑track travel that SCAN performs, reducing unnecessary head movement and often raising the number of requests completed per unit time. Therefore throughput is expected to increase, matching option A. Option B is opposite of the typical effect. Option C ignores the reduction in back‑track distance, and option D mischaracterizes C‑SCAN as random, which it is not.
Q7. Which statement best describes the difference between SCAN and C‑SCAN regarding fairness and starvation?
📖 Explanation: C‑SCAN moves the head in one direction only, then jumps back instantly, giving every request an equal chance to be served on the next sweep, which leads to more uniform waiting periods. SCAN, by contrast, services requests while moving outward and then inward, so requests that lie just after the reversal point may wait longer than those encountered earlier, creating a potential fairness issue. Option B captures this nuance. Option A incorrectly claims SCAN causes starvation, which is rare. Option C is not guaranteed; average seek can be similar. Option D is false because C‑SCAN is widely used.
Q8. A disk queue contains the following pending requests: (30,R), (70,W), (20,R), (90,W), (50,R). The head is at cylinder 40 moving outward. If writes are given priority within each SCAN sweep, in which order will the requests be serviced?
📖 Explanation: Moving outward from 40, the head first encounters cylinders greater than 40: 50R, 70W, and 90W. Because writes have priority, the algorithm will serve 70W then 90W before the read at 50R. After reaching the outer limit, the head reverses and services the remaining reads in decreasing order: 30R then 20R. Thus the service sequence is 70W, 90W, 50R, 30R, 20R, which corresponds to option C. The other options either ignore write priority or misorder the reversal.
Q9. A database server frequently reads large sequential files from a hard‑disk. Which scheduling algorithm would most likely improve its performance?
📖 Explanation: When large sequential reads dominate, an algorithm that minimizes head movement across the disk surface is advantageous. SCAN sweeps the head across the cylinder range, reducing the distance between consecutive requests and taking advantage of the sequential nature of the data. This typically yields faster access than FCFS, which follows arrival order, or Random, which adds unnecessary seeks. Priority scheduling would not address the underlying seek cost. Therefore SCAN is the best choice, as indicated by option A.