Skip to main content

Structured I/O software; SCAN vs SSTF

Short answer

I/O software is layered: interrupt handlers, device drivers, device-independent software, and user-level I/O software. SSTF gives higher throughput under light load by choosing the nearest request, but can starve requests; SCAN has slightly lower average throughput but no starvation and steady response under heavy load. For the sample queue both gave 236 cylinders.

Briefly mention the structured I/O software with suitable diagram. Compare the throughput (overall performance) of SCAN with SSTF.

Structured I/O software

I/O software is organised in four layers, so that each layer does one job and hides details from the layer above (Tanenbaum).

 User process (read, write, printf)
          |
 +-----------------------------+
 | User-level I/O software     |  libraries, spooling
 +-----------------------------+
 | Device-independent OS soft. |  naming, buffering,
 |                             |  protection, uniform I/F
 +-----------------------------+
 | Device drivers              |  device specific code
 +-----------------------------+
 | Interrupt handlers          |  wake blocked driver
 +-----------------------------+
          |
       Hardware
  1. Interrupt handlers: save registers, service the interrupt, unblock the waiting driver, then return. They are kept short and hidden deep in the OS.
  2. Device drivers: device-specific code that issues commands to the controller registers, and blocks until the interrupt arrives. One driver per device type.
  3. Device-independent software: uniform interface to drivers, naming, protection, buffering, error reporting, allocating dedicated devices, device-independent block size.
  4. User-space I/O software: library procedures (e.g. printf) and spooling systems (print spooler).

SCAN vs SSTF (throughput)

PointSSTFSCAN (elevator)
SelectionNearest requestRequest in current sweep direction
ThroughputHigh under light/moderate loadSlightly lower on average, but good and steady under heavy load
Average seekUsually lowestA little higher (goes to the end of the disk)
StarvationPossible for far requestsNone; every request is served within one sweep
Response time varianceHighLow
BiasFavours the central regionFavours middle cylinders mildly, but bounded wait

For the queue 98, 183, 37, 122, 14, 124, 65, 67 with head at 53, SSTF gives 236 and SCAN (moving towards 0) also gives 236, but SCAN is preferred when load is heavy, as SSTF can starve requests and has unpredictable delay.

Conclusion: SSTF gives slightly better raw throughput for light load, whereas SCAN gives nearly the same throughput with fairness and predictable response time.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 6 questions →