SCAN Disk Scheduling Algorithm C Program

 

Let us learn how to implement SCAN disk scheduling algorithm in C programming with its explanation, output, advantages, disadvantages and much more.

What is Scan Disk Scheduling Algorithm?

The SCAN algorithm is a disk scheduling algorithm that helps in determining the motion of a disk’s arm and head in executing the read and write requests.

In the SCAN scheduling algorithm, the disk arm moves in a single direction and executes all the jobs coming in its way.

Once the disk arm reaches the end of that direction, it reverses the direction of scanning and executes all of the jobs arriving in its path.

The SCAN scheduling algorithm is also commonly known as Elevator algorithm, and this algorithm has a very high throughput. It also reduces the response time variance compared to the SSTF algorithm.

The elevator algorithm is performed by moving the read/write head back-and-forth to the innermost and outermost track.

There are multiple enhancements performed on the elevator algorithm which is depicted by the following algorithms:

  • Circular SCAN algorithm
  • LOOK algorithm
  • Circular LOOK algorithm

Advantages

  • Lower response time variance
  • High throughput
  • Average response time

Disadvantages

  • There are chances of starvation of processes in some scenarios.

Note: This SCAN disk scheduling program in C is compiled with GNU GCC compiler using CodeLite IDE on Microsoft Windows 10 operating system.

C Program For SCAN Disk Scheduling Algorithm

   

Output

Scan Disk Scheduling Algorithm in C Programming

If you have any doubts about the implementation of SCAN disk scheduling C program, let us know about it in the comment section. Find more about it on Wikipedia.

CPU SCHEDULING ALGORITHMS
FCFS Algorithm
Circular SCAN Scheduling Algorithm
Shortest Seek Time First Scheduling Algorithm
Preemptive Shortest Job First Algorithm
Round Robin Algorithm
Shortest Job First Algorithm
Multi-Level Feedback Queue Algorithm
Preemptive Priority Algorithm
Priority Scheduling Algorithm

One thought on “SCAN Disk Scheduling Algorithm C Program

  1. Manthan Patel

    Thank you so much for this algorithm. I see that you have a good collection of quite a lot of CPU scheduling algorithms.

    Reply

Let's Discuss