S.S.T.F
Theory :
Shortest seek time first (SSTF) algorithm selects the disk I/O request which requires
the least disk arm movement from its current position regardless of the direction. It reduces the
total seek time as compared to FCFS. The shortest seek first algorithm determines which request is
closest to the current position of the head, and then services that request next. It allows the head
to move to the closest track in the service queue.
However, since the buffer is always getting new requests, these can skew the service time of requests that may be farthest away from the disk head's current location, if the new requests are all close to the current location; in fact, starvation may result, with the faraway requests never being able to make progress
And current position of Read/Write head is : 50
So, total seek time = (50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-40)+(190-170) = 208
However, since the buffer is always getting new requests, these can skew the service time of requests that may be farthest away from the disk head's current location, if the new requests are all close to the current location; in fact, starvation may result, with the faraway requests never being able to make progress
Advantages:
- In SSTF disk scheduling, the average response time is decreased.
- SSTF improves and increases throughput.
- There is less average waiting time and response time in SSTF.
Disadvantages:
- In SSTF, there may be a chance of starvation.
- SSTF is not an optimal algorithm.
- There are chances of overhead in SSTF disk scheduling because, in this algorithm, we have to calculate the seek time in advanced.
- The speed of this algorithm can be decreased because direction could be switched frequently.
Example:
Suppose the order of request is: (82,170,43,140,24,16,190)And current position of Read/Write head is : 50
So, total seek time = (50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-40)+(190-170) = 208