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.
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.
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 :
- 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.
- 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.
- 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.
- 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%.
- It overcomes situation of ‘Deceptive Idleness’ and increases performance of disk by considerable factor.
- 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.
- 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.
- 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.
- Difference between Priority Scheduling and Round Robin (RR) CPU scheduling
- Difference between Priority scheduling and Shortest Job First (SJF) CPU scheduling
- Operating Systems | CPU Scheduling | Question 1
- Operating Systems | CPU Scheduling | Question 2
- Operating Systems | CPU Scheduling | Question 3
- Operating Systems | CPU Scheduling | Question 4
- Operating Systems | CPU Scheduling | Question 5
- Operating Systems | CPU Scheduling | Question 6
- Operating Systems | CPU Scheduling | Question 7
- Difference between Preemptive Priority based and Non-preemptive Priority based CPU scheduling algorithms
- Longest Remaining Time First (LRTF) CPU Scheduling Algorithm
- Round Robin Scheduling with different arrival times
- Longest Remaining Time First (LRTF) CPU Scheduling Program
- Preemptive and Non-Preemptive Scheduling
- Earliest Deadline First (EDF) CPU scheduling algorithm
- Shortest Job First (or SJF) CPU Scheduling Non-preemptive algorithm using Segment Tree
- Difference between Turn Around Time (TAT) and Waiting Time (WT) in CPU Scheduling
- Advantages and Disadvantages of various CPU scheduling algorithms
- Difference between Preemptive and Non-preemptive CPU scheduling algorithms
- Difference between Seek Time and Rotational Latency in Disk Scheduling
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.