codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

/
/
All Subjects
🖥️

Operating Systems

25 chapters

1Intro to OS & Kernel Architecture2Process Concept & Lifecycle3System Calls & Interrupts4Process Management & PCB5Inter-Process Communication (IPC)6CPU Scheduling (FCFS, SJF, RR)7Threads (User vs Kernel Level)8Process Synchronization9Critical Section Problem10Producer-Consumer Problem11Dining Philosophers Problem12Deadlock Conditions & Prevention13Banker's Algorithm (Avoidance)14Memory Management & Paging15Memory Allocation (First Fit, Best Fit)16Paging and Segmentation17Translation Lookaside Buffer (TLB)18Virtual Memory & Demand Paging19Page Replacement Algorithms20Thrashing21File Systems & Directory Structure22File Allocation Methods23Disk Scheduling Algorithms24I/O Systems & DMA25OS Protection & Security
SubjectsOperating Systems

Disk Scheduling Algorithms

Updated 2026-04-21
3 min read

Disk Scheduling Algorithms

Magnetic Hard Disk Drives (HDDs) are mechanical devices. They consist of a spinning magnetic platter and a mechanical arm (read-write head) that moves radially across the platter.

Because mechanical movement is millions of times slower than electronic execution, the time it takes to move the disk arm to the correct track—known as Seek Time—is the primary bottleneck in disk performance.

If multiple processes submit I/O requests simultaneously, the Operating System maintains a queue of requests. The OS uses Disk Scheduling Algorithms to reorder this queue, minimizing the total movement of the disk arm.

(Note: These algorithms are entirely irrelevant for modern Solid State Drives (SSDs), as SSDs have no moving parts and zero seek time).


1. FCFS (First-Come, First-Served)

The simplest form of disk scheduling is FCFS. Requests are serviced in the exact order they arrive.

  • Pros: Inherently fair. No request will ever starve.
  • Cons: Extremely inefficient. If requests arrive for track 10, then track 190, then track 12, the disk arm swings wildly back and forth across the entire platter, maximizing mechanical wear and resulting in terrible performance.

2. SSTF (Shortest Seek Time First)

SSTF selects the request with the minimum seek time from the current head position. It chooses the pending request closest to the current head position.

  • Pros: Substantially improves performance and average response time compared to FCFS.
  • Cons: Can cause Starvation. If the head is currently at track 14, and a continuous stream of requests arrives for tracks 10, 11, 15, and 16, a request waiting for track 190 will be indefinitely postponed.

3. SCAN (The Elevator Algorithm)

The disk arm starts at one end of the disk and moves toward the other end, servicing requests as it reaches each cylinder, until it gets to the other end of the disk. At the other end, the direction of head movement is reversed, and servicing continues.

  • Analogy: It behaves exactly like an elevator. An elevator traveling up will stop at all requested floors on its way up before reversing direction to service down requests.
  • Pros: Provides a more uniform wait time than SSTF and prevents starvation.

4. C-SCAN (Circular SCAN)

A variant of SCAN designed to provide a more uniform wait time. Like SCAN, C-SCAN moves the head from one end of the disk to the other, servicing requests along the way.

  • Difference: When the head reaches the end, it immediately returns to the beginning of the disk without servicing any requests on the return trip.
  • Why? By the time the head reaches the far edge, the heaviest density of new requests is likely waiting at the opposite edge (the beginning), since those tracks have not been serviced for the longest time.

5. LOOK and C-LOOK

In practice, neither SCAN nor C-SCAN is implemented exactly as described. SCAN forces the disk arm to move all the way to track 0 and track 199, even if there are no requests there.

  • LOOK Algorithms: The arm only goes as far as the final request in each direction. As soon as there are no more requests in the current direction, the arm reverses direction immediately, without "looking" at the empty tracks at the absolute edges of the disk.


PreviousFile Allocation MethodsNextI/O Systems & DMA

Recommended Gear

File Allocation MethodsI/O Systems & DMA