Introduction
To come to the difference between Look and C-look Disk Scheduling Algorithm, we must first know Disk Scheduling. Disk Scheduling is the process that enables the I/O request in the Operating System to access the disk. This Algorithm manages those requests and determines the order of disk access granted to requests. The algorithms used for disk editing are called disk editing algorithms, and the purpose of disk algorithms is to reduce the total search time. Look and C-look Disk Scheduling Algorithm are their various types which will be discussed further.
What is an Algorithm?
In computer programming terms, an algorithm is a set of well-defined instructions for solving various problems. It gives the output you want according to the input you've entered. One typical example of an algorithm is a recipe, which contains specific instructions for preparing a meal that has to be followed one by one. Similarly, the example of adding two numbers is given below-
1-Take the inputs of two numbers
2- add those numbers using the "+" operator
3- Display the result
Computer code is algorithmic. The Internet runs using these algorithms, and all online searches are done using these algorithms. In short, we can also say that algorithms are used for computations, data processing, and reasoning.
So now we know about Algorithms let’s now discuss the different types of Disk Algorithms, as shown below-
In this article, we’ll be discussing the difference between the Look and C-Look Disk Scheduling Algorithms:
Let us first look at the Look Algorithm:
Also read, Multiprogramming vs Multitasking And Open Source Operating System
LOOK Algorithm
LOOK Algorithm is an advanced version of the SCAN Algorithm.
The head starts from the first application on one side of the disk and goes to the last request on the other side, servicing all the applications or requests in between. After reaching the final request on the other side, the head adjusts its direction by reversing. It then returns to the first request servicing all the requests in between. The process is then repeated until all requests have been accomplished. Instead of going to the last track like SCAN, this head goes to the last request before changing directions.
For example-
Consider a disk with 180 tracks (0-179) and a disk queue with the following input/output requests: 75, 90, 40, 135, 50, 170, 65, 10, 75, 90, 40, 135, 50, 170, 65, 10. The Read/Write head's initial position is 45, and it will travel to the right.
Using the LOOK disk scheduling algorithm, determine the total number of track movements of the Read/Write head.
Solution
Head movements in total,
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
Recommended Topic: Process Control Block in OS