Disk Scheduling Algorithms - TarisMajor/5143-OpSystems GitHub Wiki
Disk Scheduling Algorithms:
- Definition: Disk scheduling algorithms are techniques used by the operating system to decide the order in which disk I/O operations (reads and writes) are processed. These algorithms aim to minimize the seek time (the time taken for the disk arm to move to the correct position) and improve overall disk performance by reducing waiting times for disk access requests.
-
First-Come, First-Served (FCFS):
- Definition: In the First-Come, First-Served (FCFS) disk scheduling algorithm, the requests for disk access are processed in the order in which they arrive, without any prioritization. This method is simple but may not be efficient, as it can lead to long waiting times if earlier requests are far from the current disk head position.
-
Shortest Seek Time First (SSTF):
- Definition: The Shortest Seek Time First (SSTF) algorithm selects the disk request that is closest to the current position of the disk head. It reduces seek time by processing the request that minimizes the movement of the disk arm. However, SSTF can cause starvation, where requests farther away may never be processed if there are continuously closer requests.
-
- Definition: The SCAN (or Elevator) algorithm moves the disk arm in one direction, servicing all requests along the way until it reaches the end of the disk. Once the end is reached, it reverses direction and services requests in the opposite direction. This approach is more efficient than FCFS, as it ensures that the arm moves systematically to cover all requests. The name "elevator" comes from the analogy of an elevator moving between floors.
-
- Definition: Circular SCAN (C-SCAN) is a variation of the SCAN algorithm, where the disk arm moves in one direction, servicing requests, but instead of reversing direction at the end of the disk, it jumps to the opposite end and continues scanning in the same direction. This reduces the wait time for requests at the far end of the disk compared to SCAN, providing more uniform wait times.
-
- Definition: The LOOK algorithm is a variation of SCAN where the disk arm moves in one direction until it reaches the furthest request in that direction, then reverses direction to service the remaining requests. The C-LOOK algorithm is similar to C-SCAN, in that it moves the disk arm in one direction, but once it reaches the last request, it jumps directly to the opposite end without servicing requests along the way. Both algorithms aim to reduce unnecessary movements and provide more efficient disk scheduling.