C-LOOK vs C-SCAN Disk Scheduling Algorithm


In computer systems, disk scheduling is required for smooth operation of the system. Disk scheduling is done by the operating system of the computer, in which it schedules I/O requests arriving on the disk. Therefore, disk scheduling is also called as I/O scheduling. In computer systems, disk scheduling or I/O scheduling is important because there could be multiple I/O requests received from the different processes at the same time, but the disk controller can serve only one request at once, and all other requests have to wait for next schedule.

In operating systems, several disk scheduling algorithms used such as FCFS (First Come First Served), SSTF (Shortest Seek Time First), SCAN, C-SCAN (Circular SCAN), LOOK, CLOOK (Circular LOOK), N-STEP SCAN, and FSCAN.

What is C-LOOK Algorithm?

C-LOOK is a disk scheduling algorithm. C-LOOK stands for Circular-LOOK. C-LOOK algorithm is an improved version of the LOOK algorithm. In the case of C-LOOK algorithm, the head starts moving from the first request in one direction and the head moves towards the last request at another end. In between, it serves all requests present between starting and ending ends. Once the head is reached to the last request in one end, it jumps in another direction, and starts moving towards the remaining requests. Hence, it satisfies all the requests.

Let us understand the C-LOOK algorithm with an example. Consider a dick with 200 tracks, from 0 to 199, the disk I/O request queue is as follows −

(24, 92, 130, 45, 185)

Let the current position of the head is at number 99. Thus, the disk head will move from 99 to 92 because 92 comes on its way while moving to the other end, then 92 to 45, then 45 to 24, then 24 to 185, and then 185 to 130.

Therefore, the total head movements will be,

= | (99 - 92) | + | (92 - 45) | + | (45 - 24) | + | (24 - 185) | + | (185 - 130) | = 7 + 47 + 21 + 161 + 55 = 291 cylinders

Therefore, the average head movements will be,

= 291 / 5 = 58.2 cylinders

Now, let us discuss the basics of C-SCAN algorithm.

What is C-SCAN Algorithm?

C-SCAN algorithm stands for Circular – SCAN algorithm. It is also known as the Circular Elevator Algorithm or One-Way Elevator Algorithm. C-SCAN algorithm is basically an improved version of the SCAN algorithm. C-SCAN algorithm is called so because it treats the cylinder as a circular list.

In the C-SCAN algorithm, the head moves from the innermost cylinder to the outermost cylinder satisfying all the requests in between. When the head reaches the outermost cylinder, it moves back to the innermost cylinder without satisfying any requests and then starts sweeping again in the direction from innermost to outermost cylinder.

C-SCAN algorithm provides uniform waiting time and better response time. But it requires more seek movements. Also, it causes the head to sweep till the end of the disc even when there is no need to do so.

Differences Between C-LOOK and C-SCAN Disk Scheduling Algorithms

The following table highlights all the important differences between C-LOOK and C-SCAN Disc Scheduling Algorithms −

Key C-LOOK C-SCAN
Full form C-LOOK stands for Circular LOOK. C-SCAN stands for Circular SCAN.
Description In C-LOOK disc scheduling algorithm, the head starts moving from the first request in one direction and the head moves towards the last request at another end. In C-SCAN disc scheduling algorithm, the head moves from the innermost cylinder to the outermost cylinder satisfying all the requests in between.
Performance C-LOOK disc scheduling algorithm is best in performance among all disc scheduling algorithms. C-SCAN algorithm has relatively poor performance when compared to C-LOOK.
Request handling C-LOOK algorithm is able to handle requests more effectively. C-SCAN algorithm is less efficient in handling requests when compared to C-LOOK.
Waiting time C-LOOK algorithm provides a slight variation in the waiting time. C-SCAN algorithm provides a uniform waiting time.
Response time C-LOOK algorithm provides some variations in response time. C-SCAN algorithm provides uniform response time.
Seek time C-LOOK algorithm has shorter seek time. C-SCAN algorithm has more seek time than C-LOOK.
Direction of disc scan C-LOOK algorithm scans the entire disc only in one direction. C-SCAN algorithm scans the disc requests in the direction of disc arm movement.
Efficiency C-LOOK is relatively more efficient algorithm. C-SCAN is a less efficient algorithm.

Conclusion

The main difference between C-LOOK and C-SCAN algorithms is that C-SCAN algorithm scans requests in a single direction, whereas C-LOOK algorithm scans the requests in the direction of movement of disc arm.

Updated on: 13-Mar-2023

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements