Disk Scheduling Algorithms
Disk Scheduling Algorithms
This tutorial is prepared for those that need assistance in Disk Scheduling Algorithms.
INTRODUCTION
In operating systems, seek time is very important. Since all device requests are linked in queues,
the seek time is increased causing the system to slow down. Disk Scheduling Algorithms are
used to reduce the total seek time of any request.
PURPOSE
The purpose of this material is to provide one with help on disk scheduling algorithms.
Hopefully with this, one will be able to get a stronger grasp of what disk scheduling algorithms
do.
Although there are other algorithms that reduce the seek time of all requests, I will only
concentrate on the following disk scheduling algorithms:
First Come-First Serve (FCFS)
Shortest Seek Time First (SSTF)
Elevator (SCAN)
Circular SCAN (C-SCAN)
LOOK
C-LOOK
These algorithms are not hard to understand, but they can confuse someone because they are so
similar. What we are striving for by using these algorithms is keeping Head Movements (#
tracks) to the least amount as possible. The less the head has to move the faster the seek time will
be. I will show you and explain to you why C-LOOK is the best algorithm to use in trying to
establish less seek time.
Given the following queue -- 95, 180, 34, 119, 11, 123, 62, 64 with the Read-write head initially
at the track 50 and the tail track being at 199 let us now discuss the different algorithms.
3. Elevator (SCAN)
This approach works like an elevator does. It scans down towards the nearest end and then when
it hits the bottom it scans up servicing the requests that it didn't get going down. If a request
comes in after it has been scanned it will not be serviced until the process comes back down or
moves back up. This process moved a total of 230 tracks. Once again this is more optimal than
the previous algorithm, but it is not the best.
5. C-LOOK
This is just an enhanced version of C-SCAN. In this the scanning doesn't go past the last request
in the direction that it is moving. It too jumps to the other end but not all the way to the end. Just
to the furthest request. C-SCAN had a total movement of 187 but this scan (C-LOOK) reduced it
down to 157 tracks.
From this you were able to see a scan change from 644 total head movements to just 157. You
should now have an understanding as to why your operating system truly relies on the type of
algorithm it needs when it is dealing with multiple processes.
NOTE:
It is important that you draw out the sequence when handling algorithms like this one. One
would have a hard time trying to determine which algorithm is best by just reading the
definition. There is a good chance that without the drawings there could be miscalculations.