Difference between C-LOOK and C-SCAN Disk Scheduling Algorithm

Operating systems do disk scheduling to schedule I/O requests arriving for the disk. Disk scheduling is also known as I/O scheduling. Disk scheduling is important because multiple I/O requests may arrive by different processes, and only one I/O request can be served at a time by the disk controller. Thus other I/O requests need to wait in the waiting queue and need to be scheduled.

Two or more requests may be far from each other, resulting in greater disk arm movement. Hard drives are one of the slowest parts of the computer system and thus need to be accessed efficiently. Below are some of the important terms used in disk scheduling, such as:

  • Seek Time: Seek time is the time taken to locate the disk arm to a specified track where the data is read or written. So the disk scheduling algorithm that gives minimum average seek time is better.
  • Rotational Latency: Rotational Latency is the time the desired disk sector takes to rotate into a position so that it can access the read/write heads. So the disk scheduling algorithm that gives minimum rotational latency is better.
  • Transfer Time: Transfer time is the time to transfer the data, and it depends on the rotating speed of the disk and the number of bytes to be transferred.
  • Disk Access Time:Disk Access Time is the summation of seek time, rotational latency, and transfer time.
  • Disk Response Time: Response Time is the average time spent by request waiting to perform its I/O operation. Average Response timeis the response time of all requests. Variance Response Time is a measure of how individual requests are serviced for average response time. So the disk scheduling algorithm that gives minimum variance response time is better.

Many disk scheduling algorithms include FCFS, SSTF, SCAN, C-SCAN, LOOK, C-LOOK, RSS, LIFO, F-SCAN, and N-STEP SCAN.

What is C-SCAN Disk Scheduling Algorithm?

C-SCAN algorithm, also known as the Circular Elevator algorithm, is the modified version of the SCAN algorithm. In this algorithm, the head pointer starts from one end of the disk and moves towards the other end, serving all requests in between. After reaching the other end, the head reverses its direction and goes to the starting point, and it then satisfies the remaining requests in the same direction as before. Unlike C-LOOK, the head pointer will move till the end of the disk, whether there is a request or not.

For example: Consider a disk with 200 tracks (0-199) and the disk queue having I/O requests in the following order as follows:

The current head position of the Read/Write head is 53 and will move in the right direction. Calculate the total number of track movements of the Read/Write head using the C-SCAN algorithm.

C-LOOK vs C-SCAN Disk Scheduling Algorithm

Advantages

Here are the following advantages of the C-SCAN Scheduling Algorithm, such as:

  • The waiting time for the cylinders just visited by the head is reduced compared to the SCAN Algorithm.
  • It provides a uniform waiting time.
  • It provides a better response time.

Disadvantages

C-SCAN Scheduling Algorithm also has some disadvantages, such as:

  • It causes more seek movements as compared to the SCAN Algorithm.
  • And it causes the head to move till the end of the disk even if there are no requests to be serviced.

What is C-LOOK Disk Scheduling Algorithm?

C-LOOK is the modified version of both LOOK and C-SCAN algorithms. In this algorithm, the head starts from the first request in one direction and moves towards the last request at another end, serving all requests in between. After reaching the last request in one end, the head jumps in another direction, moves towards the remaining requests, and then satisfies them in the same direction as before. Unlike C-SCAN, the head pointer will move till the end request of the disk.

For example: Consider a disk with 200 tracks (0-199) and the disk queue having I/O requests in the following order as follows:

The current head position of the Read/Write head is 53 and will move in the right direction. Calculate the total number of track movements of the Read/Write head using the C-LOOK algorithm.

C-LOOK vs C-SCAN Disk Scheduling Algorithm

Advantages of C-LOOK Disk Scheduling Algorithm

Here are the following advantages of the C-LOOK Disk Scheduling Algorithm, such as:

  • It does not cause the head to move till the ends of the disk when there are no requests to be serviced.
  • It reduces the waiting time for the cylinders just visited by the head.
  • It provides better performance as compared to the LOOK Algorithm.
  • It does not lead to starvation.
  • It provides low variance in response time and waiting time.

Disadvantages of CLOOK Disk Scheduling Algorithm

CLOOK Disk Scheduling Algorithm has some disadvantages, such as:

  • There is an overhead of finding the end requests.

Difference between C-LOOK and C-SCAN Disk Scheduling Algorithm

These algorithms are so similar but here are the following differences between C-LOOK and C-SCAN disk scheduling algorithm, such as:

C-LOOK Disk Scheduling AlgorithmC-SCAN Disk Scheduling Algorithm
C-LOOK algorithm has the best performance in all disk scheduling algorithms.Whereas C-SCAN lags in performance when compared to C-LOOK
C-LOOK algorithm can handle requests more effectively than C-SCAN.Here handling of requests is not so good as compared to the C-LOOK algorithm.
C-LOOK provides low variance in response time and waiting time.C-SCAN provides uniform waiting time and response time.
In the C-LOOK algorithm, there is an overhead of finding the end requests.C-SCAN algorithm causes more seek time as compared to C-LOOK.
In the above example of the C-LOOK algorithm, the head moves from 53 and serves all requests in the right direction until it reaches the last request in one end. Then it jumps to the remaining requests and serves them in the right direction only.In the above example of the C-SCAN algorithm, the head moves from 53 and serves all requests in the right direction until it reaches the other end. Then it jumps to the opposite end and serves the remaining requests in the right direction only.
It gives a lower variance of response time than LOOK at the expense of throughput. It maintains a high level of throughput while further limiting variance of response times by avoiding discrimination against the innermost and outermost cylinders.