Open In App

SSTF Full Form

Improve
Improve
Like Article
Like
Save
Share
Report

SSTF (Shortest Seek Time First) is an abbreviation that selects the request which is closest to the current head position before moving the head away to service other requests. This is done by selecting the request which has the least seek time from the current head position.

Shortest Seek Time First

SSTF

SSTF scheduling priority is given to those processes which have the shortest seek, even if these requests are not the first ones in the queue. To implement this, the seek time of every request is calculated in advance in the queue and then requests are scheduled according to their seek time. SSTF does not ensure fairness as it can lead to indefinite postponement as its seek pattern tends to be highly localized. SSTF is like Shortest Job First (SJF) as it can prevent distant requests from being serviced under heavy load which can be termed as Starvation.

Algorithm

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

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

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

Step 4: Increment the total seek count with this distance.

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

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

Example:

Consider a disk with 200 tracks (0-199) and the disk queue having I/O requests in the following order as follows: 93, 176, 42, 148, 27, 14, 180. The current head position of the Read\Write head is 55. Calculate the total number of track movements of the Read/Write head using SSTF.

SSTF Scheduling

SSTF Scheduling

Total Seek Time = (55-14) + (180-14)
= 207

Advantages of Shortest Seek Time First (SSTF)

  • Throughput is better than FCFS (First Come First Serve) Disk Scheduling Algorithm.
  • Average Response Time is minimized due to less number of head movements.

Disadvantages of Shortest Seek Time First (SSTF)

  • There is high overhead as we calculate the seek time for every request in advance.
  • Starvation of a request occurs if it has a higher seek time than the other requests in the queue even if it may have arrived first in the queue.

For proper implementation of Shortest Seek Time First, refer to the Program for SSTF Disk Scheduling Algorithm.

FAQs on Shortest Seek Time First (SSTF)

1. What is the case when SSTF should not be used?

Answer:

SSTF is not a good choice when we deal with priority work or some time-bounded work. neering Mathematics – GATE CSE Previous Year … works better in these types of situations.

2. Does SSTF lead to starvation?

Answer:

SSTF (Shortest Seek TIme First) leads to starvation in the case when incoming requests are closer to the disk head.


Last Updated : 08 Sep, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads