Anticipatory Scheduling

Anticipatory Scheduling is type of Input/Output scheduling in Hard Disk which improves throughput of hard disk and enhances its efficiency by predicting synchronous read operation in near future.

History :
All existing disk scheduling algorithms are seek reducing algorithms which jump on to next request waiting in queue as per First Come First Serve (FCFS) basis because it does not keep disk idle. The previous request which is still in computational state generates next request just after some milliseconds but by that time, disk is already performing another request which is non-preemptible. Thus seek has to move quite lot while changing between different operations which reduces transfer rates and well as efficiency.

Working :
Increasing performance of Operating System is main aim which requires increasing performance of disk drives it is accessing for memory management. To increase performance, two ways are suggested :

  1. Minimizing seek operations –
    Requests can be ordered in fashion where number of seek operation decrease and distance between them as well. This can be done by grouping all nearby requests and executing them together.

  2. Prioritizing read operations over write operations –
    Write operations do not require particular operation to finish first and therefore can be pulled anytime, whereas read operations are generated one at a time and require more time than write operations. A read operation is not executed until current one has finished.

However, these two methods are contradictory in nature as they can’t be followed simultaneously. For example, if we are trying to minimize seek operations by grouping all write operations at once, then our read operations will be delayed as they are in back of queue.

On the other hand, if we are trying to prioritize read operations, then minimizing seek operations is not feasible as another read operation is not generated till one is finished so grouping of operations is not possible and it will automatically switch to any write operation requested.

Sometimes, it causes Deceptive Idleness of disk, circumstance where one read operation has finished processing and seek automatically switches to write operation and gets to know that there are no write operations waiting and has to return back to another read operation which was requested in interval when switch happened. This reduces efficiency of operating system and delays synchronous read operations as well.

Anticipatory Scheduling is solution to ‘Deceptive Idleness’ problem and it is method to pause for short duration (few milliseconds) after read operation to predict any synchronous read operation that may be scheduled just after current one and service it right away. After the timer goes off it switches to perform write operations.

Applications :

  1. It is used in Apache Web Server which increases throughput by more than 70% as it significantly improves utilization of disk and it’s management.
  2. It is also used in Andrew file system Benchmark used to capture file server workload in software development and reduces execution time for scanning process by 54%.

Advantages :

  1. It overcomes situation of ‘Deceptive Idleness’ and increases performance of disk by considerable factor.
  2. It does not require prefetching of operations as most of the time future events aren’t known to application. Also overhead cost of storing such information can increase cost. This can be overcome by just waiting for few moments before switching the seek.

Disadvantages :

  1. The waiting time is bound to increase and cost associated with it as well. At instances, it may not make optimal decisions and wait even if there is no successive read operation scheduled which would increase delay.
  2. There are implementation issues associated with it which include calculating positioning time for requests and making cheap timeout mechanism.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.