Simulation of Elevator and Shortest Seek Time First (SSTF) Disk Scheduling Algorithm
Requirements:
_ Must be implemented in C (not C++).
Description:
The project should implement two basic disk scheduling algorithms.
1. Shortest seek time algorithm
2. Elevator algorithm
Overview
A hard disk drive contains a collection of plates called platters. However for the sake of simplicity, we consider a single platter for the project. Each surface of a platter is divided into circular tracks. Each track is further divided into sectors. Reading and writing on the disk is done on sector by sector basis. A group of tracks that are aligned on top of each other forms a cylinder. There is a head connected to arm of each surface which handles all I/O operations. During an I/O operation, the disk head is moved over the destination track. This time is called seek time. Then the disk is rotated further to position the destination sector under the head. This time is called rotational latency. Then the I/O operation is performed.
Shortest Seek Time First Algorithm
After a request is served, the next request to be served is the one which is in the track closest to the current disk head irrespective of the direction in which disk head was moving. It might be easier to implement, but it can lead to starvation if requests are continuously made close to the current disk head. Also slow down in speed might occur if the direction has to be changed frequently.