Compare FCFS, SSTF, SCAN and C-SCAN disk scheduling.
HardConceptFile Systems & Disk Scheduling
Answer
On a hard disk drive (HDD), the slowest part of an access is the seek: moving the read/write head to the right track (cylinder). Disk scheduling orders pending requests to reduce total head movement; SSDs have no moving head, so it matters mainly for HDDs.
- FCFS: serve requests in arrival order. It is fair, but the head may swing back and forth.
- SSTF (Shortest Seek Time First): serve the nearest request next. Movement is low, but far-away requests can starve.
- SCAN (the elevator algorithm): sweep in one direction to the end of the disk, serving requests, then reverse. Nothing starves.
- C-SCAN (circular SCAN): serve in one direction only, then jump back to the start, which gives more uniform waiting times. LOOK and C-LOOK turn at the last request instead of the edge.
Example: cylinders 0–99, head at 50 moving up, requests 20, 70, 10, 90.
FCFS, order 50, 20, 70, 10, 90: 30 + 50 + 60 + 80 = 220.
SSTF, order 50, 70, 90, 20, 10: 20 + 20 + 70 + 10 = 120.
SCAN, up to 99 and then down to 10: 49 + 89 = 138.
C-SCAN, up to 99, jump to 0, then up to 20: 49 + 99 + 20 = 168, counting the jump.
More in File Systems & Disk Scheduling
| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | What is an inode, and what information does it store? | Concept | Medium | Read the answer to What is an inode, and what information does it store? | |||
| 2 | How do directories map file names to inodes, and what is the difference between a hard link and a soft link? | Concept | Medium | Read the answer to How do directories map file names to inodes, and what is the difference between a hard link and a soft link? | |||
| 3 | What are the contiguous, linked and indexed file allocation methods? | Concept | Medium | Read the answer to What are the contiguous, linked and indexed file allocation methods? | |||
| 4 | Compare FCFS, SSTF, SCAN and C-SCAN disk scheduling. | Concept | Hard | Read the answer to Compare FCFS, SSTF, SCAN and C-SCAN disk scheduling. |