![]() |
VOOZH | about |
Disk scheduling algorithms manage how data is read from and written to a computer's hard disk. These algorithms help determine the order in which disk read and write requests are processed.
Disk Access Time = Seek Time + Rotational Latency + Transfer Time
Total Seek Time = Total head Movement * Seek Time
Disk Response Time
There are several Disk Several Algorithms. We will discuss in detail each one of them.
FCFS (First Come First Serve) is the simplest disk scheduling algorithm where requests are processed in the order they arrive in the queue. It is easy to implement but may lead to higher seek time and lower efficiency.
Suppose the order of request is- (50,82,170,43,140,24,16,190) and current position of Read/Write head is: 50
So, total overhead movement (total distance covered by the disk arm) =
(82-50)+(170-82)+(170-43)+(140-43)+(140-24)+(24-16)+(190-16) =642
Advantages of FCFS
Here are some of the advantages of First Come First Serve.
Disadvantages of FCFS
Here are some of the disadvantages of First Come First Serve.
Learn more in detail: FCFS
SSTF (Shortest Seek Time First) is a disk scheduling algorithm that selects the request closest to the current disk arm position, minimizing seek time. It improves performance compared to FCFS by reducing average response time and increasing system throughput.
Example:
Suppose the order of request is- (82,170,43,140,24,16,190) and current position of Read/Write head is: 50
total overhead movement (total distance covered by the disk arm) =
(50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-140)+(190-170) =208
Advantages of Shortest Seek Time First
Here are some of the advantages of Shortest Seek Time First.
Disadvantages of Shortest Seek Time First
Here are some of the disadvantages of Shortest Seek Time First.
Learn More in detail: shortest seek time first
The SCAN algorithm is a disk scheduling method where the disk arm moves in one direction, servicing requests along the way, and then reverses direction at the end, similar to an elevator. It provides better performance than simple algorithms but may cause longer waiting time for some requests.
Suppose the requests to be addressed are-82,170,43,140,24,16,190 and the Read/Write arm is at 50, and it is also given that the disk arm should move "towards the larger value".
SCAN goes to disk end even if no request exists there
Therefore, the total overhead movement (total distance covered by the disk arm) is calculated as
= (199-50) + (199-16) = 332
Advantages of SCAN Algorithm
Here are some of the advantages of the SCAN Algorithm.
Disadvantages of SCAN Algorithm:
Learn More in detail: SCAN
C-SCAN (Circular SCAN) is an improvement over the SCAN algorithm where the disk arm moves in one direction only. Instead of reversing, it jumps back to the beginning of the disk and continues servicing requests, providing more uniform wait times.
Example:
Suppose the requests to be addressed are- 82,170,43,140,24,16,190 and the Read/Write arm is at 50, and it is also given that the disk arm should move "towards the larger value".
So, the total overhead movement (total distance covered by the disk arm) is calculated as:
=(199-50) + (199-0) + (43-0) = 391
Advantages of C-SCAN Algorithm:
Learn more in detail: C-SCAN
Disadvantages of C-SCAN Algorithm:
LOOK is a disk scheduling algorithm similar to SCAN, but instead of moving the disk arm to the end, it only goes up to the last pending request in that direction and then reverses, reducing unnecessary movement.
Example:
Suppose the requests to be addressed are- 82,170,43,140,24,16,190 and the Read/Write arm is at 50, and it is also given that the disk arm should move "towards the larger value".
So, the total overhead movement (total distance covered by the disk arm) is calculated as:
= (190-50) + (190-16) = 314
Advantages
Disadvantages of LOOK Algorithm:
Learn more in detail: LOOK
C-LOOK is similar to C-SCAN but avoids unnecessary movement by going only up to the last request in one direction and then jumping to the last request at the other end, instead of going to the diskβs extreme end.
Example: Suppose the requests to be addressed are-82,170,43,140,24,16,190 and the Read/Write arm is at 50, and it is also given that the disk arm should move "towards the larger value"
So, the total overhead movement (total distance covered by the disk arm) is calculated as
= (190-50) + (190-16) + (43-16) = 341
Advantages:
Disadvantages of C-LOOK Algorithm:
Learn more in detail: C-LOOK
Random Scheduling is a technique where selects requests randomly for servicing. It is useful in systems with unpredictable conditions like random processing times or machine failures, and is mainly used for analysis and simulation.
In LIFO (Last In, First Out) algorithm, the newest jobs are serviced before the existing ones i.e. in order of requests that get serviced the job that is newest or last entered is serviced first, and then the rest in the same order.
N-STEP SCAN is a disk scheduling algorithm where requests are divided into groups of size N and each group is processed completely before moving to the next. This ensures fair service and prevents starvation of requests.
It eliminates the starvation of requests completely.
Learn more in detail: N-STEP SCAN
This algorithm uses two sub-queues. During the scan, all requests in the first queue are serviced and the new incoming requests are added to the second queue. All new requests are kept on halt until the existing requests in the first queue are serviced.
Learn more in detail: F-SCAN
Note: Average Rotational latency is generally taken as 1/2(Rotational latency).