Disc Scheduling Algorithm
Disc Scheduling Algorithm
Disc scheduling is an important process in operating systems that determines the order
in which disk access requests are serviced.
The objective of disc scheduling is to minimize the time it takes to access data on the
disk and to reduce the time it takes to complete a disk access request.
Two factors determine disk access time:
seek time and rotational latency
Seek time is the time it takes for the disk head to move to the desired location on the
disk, while rotational latency is the time the disk takes to rotate the desired data sector
under the disk head.
Disk scheduling algorithms are an essential component of modern operating systems
and are responsible for determining the order in which disk access requests are
serviced.
The primary goal of these algorithms is to minimize disk access time and improve
overall system performance.
First-Come-First-Serve
Suppose we have an order of disk access requests: 20 150 90 70 30 60. The disk head is −
The total seek time = (50-20) + (150-20) + (150-90) + (90-70) + (70-30) + (60-30) = 310
Shortest-Seek-Time-First
Shortest Seek Time First (SSTF) is a disk scheduling algorithm used in operating
systems to efficiently manage disk I/O operations.
The goal of SSTF is to minimize the total seek time required to service all the disk
access requests.
In SSTF, the disk head moves to the request with the shortest seek time from its
current position, services it, and then repeats this process until all requests have been
serviced.
The algorithm prioritizes disk access requests based on their proximity to the current
position of the disk head, ensuring that the disk head moves the shortest possible
distance to service each request.
Example
In this case, for the same order of success request, the total seek time = (60-50) + (70-60) +
(90-70) + (90-30) + (30-20) + (150-20) = 240
SCAN
Example
If we consider that the head direction is left in case of SCAN, the total seek time = (50-30) +
(30-20) + (20-0) + (60-0) + (60-70) + (90-70) + (90-150) = 200
C-SCAN
The C-SCAN (Circular SCAN) algorithm operates similarly to the SCAN algorithm,
but it does not reverse direction at the end of the disk.
Instead, the disk head wraps around to the other end of the disk and continues to
service requests.
This algorithm can reduce the total distance the disk head must travel, improving disk
access time.
The C-SCAN algorithm is often used in modern operating systems due to its ability to
reduce disk access time and improve overall system performance.
Example
For C-SCAN, the total seek time = (60-50) + (70-60) + (90-70) + (150-90) + (199-150) +
(199-0) + (20-0) + (30-20) = 378
LOOK
The LOOK algorithm is similar to the SCAN algorithm but stops servicing requests as
soon as it reaches the end of the disk.
This algorithm can reduce the total distance the disk head must travel, improving disk
access time.
This algorithm can lead to long wait times for requests that are made near the end of
the disk, as they must wait for the disk head to wrap around to the other end of the
disk before they can be serviced.
The LOOK algorithm is often used in modern operating systems due to its ability to
reduce disk access time and improve overall system performance.
Example
Considering the head direction is right, in this case, the total seek time = (60-50) + (70-60) +
(90-70) + (150-90) + (150-30) + (30-20) = 230
C-LOOK
Example
For the C-LOOK algorithm, the total seek time = (60-50) + (70-60) + (90-70) + (150-90) +
(150-20) + (30-20) = 240