Difference Between SSTF and LOOK Disk Scheduling Algorithms


SSTF (Shortest Seek Time First) and LOOK are both disk scheduling algorithms used in operating systems to optimize the order in which disk requests are serviced. While they share the goal of minimizing disk seek time, they employ different strategies to achieve this.

SSTF Disk Scheduling Algorithm

The Shortest Seek Time First (SSTF) disk scheduling algorithm is a widely used approach in operating systems to optimize disk access time. It aims to reduce the total seek time by selecting the disk request that requires the least movement of the disk arm from its current position. In this article, we will explore the working principles and benefits of the SSTF disk scheduling algorithm.

The SSTF algorithm operates by continuously scanning the pending disk requests and selecting the one with the shortest seek time. Seek time refers to the time taken by the disk arm to move from its current position to the requested track. By choosing the nearest request, the algorithm minimizes the arm movement and consequently reduces the overall disk access time. Here are some key points about the SSTF algorithm −

  • Seek Time Optimization  SSTF aims to minimize the seek time by always choosing the nearest request. It scans the request queue to find the closest request in terms of the head movement.

  • Fast Response Time  SSTF performs well in terms of response time, as it prioritizes the nearest requests, reducing the average time taken to access data.

  • Potential Starvation  SSTF may lead to starvation of certain requests located farther from the current head position. This is because the algorithm focuses solely on the closest requests and may continuously skip over farther requests.

LOOK Disk Scheduling Algorithm

Disk scheduling algorithms are used to determine the order in which disk I/O requests are serviced. The LOOK algorithm is one such scheduling algorithm that optimizes the movement of the disk arm. It is an improved version of the SCAN algorithm and is commonly used in modern operating systems. The LOOK algorithm avoids unnecessary arm movements, thereby reducing the average seek time and improving disk performance.

The LOOK algorithm scans the disk in a particular direction and services the pending I/O requests in that direction. When there are no more pending requests in that direction, the algorithm reverses its direction and continues servicing requests in the opposite direction. It eliminates the inefficiency of the SCAN algorithm, which always scans the entire disk regardless of pending requests. Here are some important characteristics of the LOOK algorithm:

  • Circular Scanning  LOOK uses a circular scanning technique, where the head moves in one direction until it reaches the end of the disk, and then it reverses its direction without visiting the empty portions of the disk.

  • Improved Starvation Prevention  LOOK addresses the issue of potential starvation in SSTF. It scans both directions and serves requests in a balanced manner, preventing long waiting times for requests located farther away.

  • Reduced Head Movement  By scanning in both directions, LOOK reduces the overall head movement compared to SSTF. It aims to optimize disk performance by minimizing seek time and maximizing the throughput of disk operations.

Differences Between SSTF and LOOK Disk Scheduling Algorithms

The following table highlights the differences between SSTF and LOOK Disk Scheduling Algorithms −

Feature

SSTF Disk Scheduling Algorithm

LOOK Disk Scheduling Algorithm

Seek Strategy

Selects the request with the shortest seek time from the current head position

Scans in one direction until the last request, then reverses direction and scans to the other end

Handling of Incoming Requests

Handles the requests in the order of their arrival

Handles the requests in the order of their arrival

Direction Change

Does not change direction until all requests in the current direction have been serviced

Changes direction when there are no more pending requests in the current direction

Efficiency in Disk Access

May lead to starvation for some requests as it always selects the nearest request, potentially ignoring others

More balanced approach that ensures all requests are eventually serviced

Disk Head Movement

Less efficient in terms of disk head movement as it may unnecessarily move back and forth across the disk

More efficient in terms of disk head movement as it avoids unnecessary backtracking

Throughput

May have lower throughput due to head movements and possible starvation of certain requests

Generally higher throughput due to more balanced servicing of requests

Implementation Complexity

Simpler to implement due to the straightforward selection of the shortest seek time

Requires additional logic to handle direction changes and reverse scanning

Conclusion

The primary difference between SSTF and LOOK disk scheduling algorithms lies in their disk head movement strategy. SSTF always chooses the nearest request, leading to potentially higher arm movement, while LOOK scans in a specific direction until reaching the end, reducing unnecessary movement. The choice between the two algorithms depends on factors such as the workload characteristics and the desired optimization goals for the system.

Updated on: 13-Jul-2023

178 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements