Disk Scheduling Algorithms
Disk Scheduling is one of the most important topics in Operating Systems. It determines the order in which disk I/O requests are processed. Since disk access time is much slower compared to RAM, efficient scheduling improves overall system performance significantly.
1. Why Disk Scheduling is Needed
A disk drive contains multiple tracks and sectors. When multiple processes request disk access, the disk arm (read/write head) must move to different track positions.
This movement is called Seek Time, and it is the most time-consuming part of disk access.
Goal of Disk Scheduling:
- Minimize seek time
- Maximize throughput
- Reduce waiting time
- Ensure fairness
2. Components of Disk Access Time
- Seek Time – Time to move head to correct track
- Rotational Latency – Time for sector to rotate under head
- Transfer Time – Time to transfer data
Disk scheduling mainly focuses on reducing seek time.
3. FCFS (First Come First Serve)
FCFS processes requests in the order they arrive.
Example:
Request Queue: 98, 183, 37, 122, 14, 124, 65, 67 Initial Head Position: 53
The head moves sequentially according to request order.
Advantages
- Simple
- Fair
Disadvantages
- High average seek time
- Poor performance
4. SSTF (Shortest Seek Time First)
SSTF selects the request closest to current head position.
Advantages
- Reduced seek time
- Better than FCFS
Disadvantages
- May cause starvation
- Not fully fair
5. SCAN (Elevator Algorithm)
SCAN moves the disk arm in one direction servicing requests until it reaches the end, then reverses direction.
It works like an elevator.
Advantages
- Better performance
- Prevents starvation
6. C-SCAN (Circular SCAN)
C-SCAN moves in one direction only. After reaching the end, it jumps back to beginning without servicing requests on return.
Advantages
- Uniform waiting time
- Fairer than SCAN
7. LOOK Algorithm
LOOK is similar to SCAN but stops at last request instead of going to disk end.
Improves efficiency by avoiding unnecessary movement.
8. C-LOOK Algorithm
C-LOOK is similar to C-SCAN but only moves as far as last request before jumping.
9. Comparison Table
| Algorithm | Seek Time | Starvation | Fairness |
|---|---|---|---|
| FCFS | High | No | High |
| SSTF | Low | Yes | Medium |
| SCAN | Low | No | Good |
| C-SCAN | Low | No | Very Good |
| LOOK | Lower | No | Good |
| C-LOOK | Lower | No | Very Good |
10. Numerical Example (Exam Focused)
Request Queue: 176, 79, 34, 60, 92, 11, 41, 114 Initial Head Position: 50
Students are commonly asked to calculate total head movement using different algorithms. Practice solving using FCFS, SSTF, SCAN and C-SCAN.
11. Which Algorithm is Best?
- FCFS → Simple but inefficient
- SSTF → Good but risk of starvation
- SCAN → Balanced performance
- C-SCAN → Most uniform waiting time
- LOOK / C-LOOK → Most efficient practical variants
12. Real-World Relevance
Modern SSDs reduce mechanical seek time, but disk scheduling remains important in HDD-based systems and theoretical OS studies.
Conclusion
Disk Scheduling Algorithms play a critical role in improving I/O performance in Operating Systems. By minimizing seek time and optimizing request order, they significantly enhance system efficiency.
Understanding FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK is essential for:
- Operating System exams
- Technical interviews
- System-level programming
Frequently Asked Questions (FAQs)
What is disk scheduling in OS?
Disk scheduling determines the order in which disk I/O requests are serviced.
Which disk scheduling algorithm is best?
LOOK and C-LOOK are generally most efficient, while C-SCAN provides uniform waiting time.
What is seek time?
Seek time is the time required for the disk head to move to the required track.
Comments
Post a Comment