Look disk scheduling

The LOOK algorithm is a disk scheduling algorithm that scans the disk from the current position of the disk arm to the last request in one direction and then moves back to the first request in the opposite direction.

The LOOK algorithm is designed to reduce the seek time by minimizing the distance the disk arm has to travel to service a request. The algorithm schedules the requests in such a way that the disk arm moves continuously in one direction without any backtracking, which indirectly improves performance by maximizing throughput and reducing the total time required to access and retrieve data from the disk.

Functionality

 

LOOK aims to minimize disk arm movement and reduce seek time by optimizing the order in which disk I/O requests are serviced. It achieves this by scanning the disk in one direction until it encounters the last request in that direction, and then reverses direction without necessarily reaching the end of the disk. This approach helps in reducing the average seek time compared to simpler algorithms like First-Come, First-Served (FCFS).
How Algorithm work ?
  • The disk scheduler maintains a queue of pending disk I/O requests.
  • The disk arm starts servicing requests from its current position.
  • It moves in one direction (either inward or outward) until it reaches the last request in that direction.
  • Upon reaching the last request, the disk arm reverses its direction without necessarily reaching the edge of the disk.
  • It continues servicing requests in the reversed direction until there are no more pending requests.
  • Once all requests are serviced, the disk arm remains idle until new requests arrive.

Advantages & Disadvantages

Advantages :

  • Reduced Seek Time: LOOK optimizes disk arm movement, leading to shorter seek times and faster disk I/O operations.
  • Fairness: It ensures fairness in servicing disk requests by preventing starvation of requests that are located far from the disk arm's current position.
  • Simplicity: LOOK is relatively simpler to implement compared to more complex algorithms like SCAN or C-SCAN.

Disadvantages :

  • Increased Variance: There might be an increased variance in service times for requests located at the boundary where the disk arm reverses direction, potentially leading to longer wait times.
  • Suboptimal Performance: In scenarios with requests spread across the entire disk, other algorithms like Shortest Seek Time First (SSTF) might offer better performance.
C-look disk scheduling
The CLOOK (Circular LOOK) algorithm is a disk scheduling algorithm used in operating systems to optimize the movement of the disk arm, reducing seek time and improving disk I/O performance. It's a variation of the LOOK algorithm, which scans the disk in one direction until it reaches the end and then reverses direction, scanning back to the start. The CLOOK algorithm, however, operates only in one direction, providing better performance in certain scenarios.

Functionality

 

C-LOOK (Circular LOOK) is a disk scheduling algorithm that aims to minimize disk arm movement and reduce seek time by optimizing the order in which disk I/O requests are serviced. It operates similarly to LOOK but with a circular scanning pattern, hence the name "C-LOOK."

C-LOOK starts servicing requests at one end of the disk and scans in one direction until it encounters the last request in that direction. Instead of reversing direction immediately, as in LOOK, C-LOOK reverses direction only after reaching the end of the disk. This circular pattern avoids unnecessary arm movement to the beginning of the disk, resulting in reduced seek time.

How Algorithm work ?
  • Initialization: The disk arm starts at a particular position on the disk.
  • Scheduling Request: When a disk I/O request arrives, the algorithm services the requests in a specific direction (usually from lower to higher disk cylinder numbers).
  • Scan: The algorithm scans sequentially in the chosen direction until it reaches the last request in that direction or the end of the disk.
  • Back to the Beginning: Once reaching the last request or end of the disk, instead of reversing direction, the disk arm jumps back to the beginning of the disk (hence the "circular" aspect of the algorithm) and continues serving requests until reaching the previous position of the disk arm.
  • Completion: After servicing all requests between the starting position and the current position of the disk arm, the algorithm finishes.