Shortest Seek Time First



Introduction

SSTF is another type of scheduling algorithm. In this type of disk scheduling, the job which has less seek time will be executed first. So, in SSTF (shortest seek time first) scheduling, we have to calculate the seek time first. and after calculating the seek time, each request will be served on the basis of seek time. The request which is close to the disk arm will be first executed. There are some drawbacks in FCFS. To overcome the limitations that arise in the FCFS. SSTF scheduling is implemented.


Advantages

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

2. Increased throughput.


Disdvantages

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.


Example

Consider a disk that contains 200 tracks (0-199). The request queue includes track number 82, 170, 43, 140, 24, 16, 190, respectively. The current position of the read/write head is 50.


Before solving the above example, we have to know about the seek time. Seek Time: -Seek time is the time required to move the desired track. To find the seek time, we can use this simple formula. seek time = Destination - Source or = Source - Destination Now, we can solve the given example. As mentioned in the following example, disk contains 200 tracks. So, we will take a track line between 0 to 199. The current position of the read/write head is 50. So, we start at 50. We can see in the following figure that the current or initial position of read/write head is 50. Now for further movement of read/write head, we calculate the seek time.


sstf img

Total Number of cylinders moved by the head = (50-16) + (190-16) = 208