SSTF

Downward Arrow

About

SSTF

In SSTF, requests having shortest seek time are executed first. So, the seek time of every request is calculated in advance in the queue and then they are scheduled according to their calculated seek time. As a result, the request near the disk arm will get executed first. SSTF is certainly an improvement over FCFS as it decreases the average response time and increases the throughput of system.


Advantages

  1. In SSTF disk scheduling, the average response time is decreased.

  2. Increased throughput.

Disadvantages

  1. In SSTF, there may be a chance of starvation.

  2. SSTF is not an optimal algorithm.

  3. There are chances of overhead in SSTF disk scheduling because, in this algorithm, we have to calculate the seek time in advanced.

  4. The speed of this algorithm can be decreased because direction could be switched frequently.

Algorithm

  1. Let Request array represents an array storing indexes of tracks that have been requested. ‘head’ is the position of disk head.

  2. Find the positive distance of all tracks in the request array from head.

  3. Find a track from requested array which has not been accessed/serviced yet and has minimum distance from head.

  4. Increment the total seek count with this distance.

  5. Currently serviced track position now becomes the new head position.

  6. Go to step 2 until all tracks in request array have not been serviced.

Implementation

CHART WILL APPEAR HERE