0
0
Operating Systemsknowledge~3 mins

Why SSTF (Shortest Seek Time First) in Operating Systems? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if you could cut your waiting time in half just by choosing the nearest task first?

The Scenario

Imagine you are manually moving a book cart in a large library to pick books requested by readers scattered all over the shelves.

You try to pick books in the order requests came in, walking back and forth across the library.

The Problem

This approach wastes a lot of time walking long distances repeatedly.

You get tired, and readers wait longer for their books.

It is slow and inefficient because you don't plan your path smartly.

The Solution

SSTF helps by always choosing the next closest book to pick.

This way, you minimize walking distance and speed up the whole process.

It smartly reduces waiting time by focusing on the nearest request first.

Before vs After
Before
requests = [55, 58, 39, 18, 90]
for req in requests:
    move_to(req)
After
while requests:
    next_req = closest_to(current_position, requests)
    move_to(next_req)
    requests.remove(next_req)
What It Enables

SSTF enables faster and more efficient handling of disk or task requests by always serving the nearest next request first.

Real Life Example

In a disk drive, SSTF schedules read/write requests by moving the disk arm to the closest track next, reducing the total movement and speeding up data access.

Key Takeaways

SSTF picks the closest next request to reduce movement.

This reduces waiting time and improves efficiency.

It is widely used in disk scheduling to speed up data access.