Background
LOOK/ C-LOOK ALGORITHM

Look and C-look are two disk scheduling algorithms used by operating systems to determine the order in which disk requests are processed. The disk scheduling algorithm plays an important role in determining the overall performance of the system, as it determines the efficiency with which the system accesses and retrieves data from the disk.

The Look algorithm, also known as the elevator algorithm, is a disk scheduling algorithm that works by moving the disk arm in one direction only, either towards the outermost track or towards the innermost track of the disk. When a disk request is made, the Look algorithm determines the direction in which the disk arm is currently moving, and then schedules the request to be processed in the same direction. Once all the requests in that direction have been processed, the algorithm changes direction and starts processing the requests in the other direction.

The C-look algorithm is an improvement over the Look algorithm, as it tries to reduce the average access time by avoiding unnecessary disk arm movement. The C-look algorithm works by moving the disk arm towards the last request in the queue in the current direction, and then reversing direction once it reaches the last request. This means that the disk arm only moves back and forth between the requests that are currently in the queue, without having to move all the way to the outermost or innermost track of the disk.

However, the Look and C-look algorithms may not be suitable for all scenarios. For example, if there are a large number of requests for data on a particular track of the disk, the Look and C-look algorithms may spend a lot of time moving the disk arm back and forth between that track and the other tracks. In such cases, other disk scheduling algorithms, such as the Shortest Seek Time First (SSTF) or the SCAN algorithm, may be more suitable.

Advantages

May not be suitable for all scenarios: In some cases, such as when there are a large number of requests for data on a particular track of the disk, these algorithms may not be the most efficient choice. Other disk scheduling algorithms, such as the Shortest Seek Time First (SSTF) or the SCAN algorithm, may be more suitable. Can cause delay: The Look and C-look algorithms may cause a delay for certain disk requests if they are located on the opposite side of the disk arm's current position, as the algorithm may need to move the arm to the other side of the disk to process those requests. Can result in uneven wear: These algorithms may cause uneven wear on the disk over time, as certain areas of the disk may be accessed more frequently than others.

Disadvantages

Difficult to accurately estimate processing times, which can lead to longer waiting times for longer processes. May result in starvation of longer processes, which can impact the overall system performance. Preemptive SJF can lead to more overhead due to the frequent switching between processes.