# Difference between Look and C-Look Disk Scheduling Algorithm

In this article, you will learn about the difference between the LOOK and C-LOOK Disk Scheduling Algorithm. But before discussing the differences, you have to know about the LOOK and C-LOOK Disk Scheduling Algorithm.

## What is the LOOK Disk Scheduling Algorithm?

It is the more advanced version of the SCAN disk scheduling algorithm. In this algorithm, the head begins at one end of the disk and works its way to the other end, and serving all requests along the way. When the head reaches the end of one end's last request, it changes direction and returns to the first request, servicing all requests in between. Unlike SCAN, instead of going to the last track, this head goes to the last request and then changes direction.

Example:

Let's take an example to understand the LOOK Disk Scheduling Algorithm. Let's take a disk with 180 tracks (0-179) and the disk queue having input/output requests in the following order: 75, 90, 40, 135, 50, 170, 65, 10. The initial head position of the Read/Write head is 45 and would move on the right-hand side. Find the total number of track movements of the Read/Write head using the LOOK disk scheduling algorithm.

Solution:

The initial head point is 45,

= (50-45) + (65-50) + (75-65) + (90-75) + (135-90) + (170-135) + (170-40) + (40-10)

= 5 + 15 + 10 + 15 + 45 + 35 + 130 + 30

= 285

1. It provides better performance in comparison to the SCAN algorithm.
2. The LOOK scheduling algorithm avoids starvation.
3. The head will not move to the end of the disk if no more requests are fulfilled.
4. Waiting time and response time have a low variance.

1. There is an overhead of finding the final requests.

## C-LOOK Disk Scheduling Algorithm

It is a combination of the LOOK and SCAN disk scheduling algorithms. In this disk scheduling algorithm, the head begins from the initial request to the last request in the other direction and serves all requests in between. The head jumps in the other direction after finishing the last request at one end and proceeds towards the remaining requests, completing them in the same direction as previously. Unlike LOOK, it only responds to requests in one direction.

Example:

Let's take an example to understand the C-LOOK Disk Scheduling Algorithm. Let's take a disk with 180 tracks (0-179) and the disk queue having input/output requests in the following order: 75, 90, 40, 135, 50, 170, 65, 10. The initial head position of the Read/Write head is 45 and would move on the right-hand side. Find the total number of track movements of the Read/Write head using the C-LOOK disk scheduling algorithm.

Solution:

The initial head point is 45,

= (50-45) + (65-50) + (75-65) + (90-75) + (135-90) + (170-135) + (170-10) + (40-10)

= 5 + 15 + 10 + 15 + 45 + 35 + 160 + 30

= 315

1. It provides better performance compared to the LOOK disk scheduling algorithm.
2. The starvation is avoided in the C-LOOK disk scheduling algorithm.
3. If no requests are to be served, the head doesn't have to go all the way to the end of the disk in the C-LOOK disk scheduling algorithm.
4. In C-LOOK, there is minimal waiting time for cylinders that are only visited by the head.
5. Waiting time and response time have a low variance.

1. The overhead of finding the end requests is present in C-LOOK.

## Main Differences between the LOOK and C-LOOK Disk Scheduling Algorithm

Here, you will learn the main differences between the LOOK and C-LOOK Disk Scheduling Algorithm. The main differences between the LOOK and C-LOOK Disk Scheduling Algorithm are as follows:

1. The LOOK disk scheduling algorithm is the more advanced version of the SCAN disk scheduling algorithm. In contrast, the C-LOOK is a combination of the LOOK and SCAN algorithms.
2. The head of the LOOK disk scheduling algorithm may serve the request in both directions. In contrast, the head of the C-LOOK disk scheduling algorithm may serve the request in only one direction.
3. It is not better in performance than the C-LOOK disk scheduling algorithm. In contrast, the C-LOOK disk scheduling algorithm outperforms all other disk scheduling techniques.
4. LOOK disk scheduling algorithm has better throughput and a faster response time with low variance. In contrast, the C-LOOK disk scheduling algorithm gives uniform waiting time and response time.
5. In LOOK, the handling of the request is not as good as the C-LOOK disk scheduling algorithm. In contrast, the C-LOOK may manage the requests more effectively than the LOOK disk scheduling algorithm.

Here, you will learn the head-to-head comparison between the LOOK and C-LOOK Disk Scheduling Algorithm. The main differences between the LOOK and the C-LOOK Disk Scheduling Algorithm are as follows:

LOOK Disk Scheduling Algorithm C-LOOK Disk Scheduling Algorithm
It is the more advanced version of the SCAN algorithm. It is a combination of the LOOK and SCAN disk scheduling algorithms.
It has better throughput and a faster response time with low variance. It gives uniform waiting time and response time.
In LOOK, the handling of the request is not as good as the C-LOOK disk scheduling algorithm. It may handle requests more effectively than the LOOK disk scheduling algorithm.
It is not better in performance than the C-LOOK. It outperforms all other disk scheduling techniques.
The head of the LOOK disk scheduling algorithm may serve the request in both directions. The head of the C-LOOK disk scheduling algorithm may serve the request in only one direction.
In the LOOK algorithm example, the head starts at 45 and proceeds on the right-hand side, serving all requests until it reaches the last request at one end. It changes the head direction and serves the remaining requests in the opposite direction. In the C-LOOK algorithm example, the head moves from 45 and serves all requests on the right-hand side until it reaches the last request on one end. It moves on to the remaining requests and serves them only in the right-hand side direction.