Difference between SSTF and LOOK Disk Scheduling AlgorithmOperating systems do disk scheduling to schedule I/O requests arriving for the disk. Disk scheduling is also known as I/O scheduling. The goal of disk scheduling algorithms is to maximize the throughput and minimize the response time. Here are six different disk scheduling algorithms, such as First Come First Serve (FCFS), Shortest Seek Time First (SSTF), Scan, Look, C-Scan, and C-look disk scheduling by comparing their head movement in different runs. What is SSTF Disk Scheduling Algorithm?SSTF stands for Shortest Seek Time First. This algorithm serves the task request, which is closest to the current position of the head or pointer. Here, the direction of the head plays a vital role in determining total head movement. If a tie occurs between requests, then the head will serve the request, which encounters it in its ongoing direction. Unlike C-LOOK, the SSTF algorithm is very efficient in total seek time. In SSTF, requests having the shortest seek time are executed first. So, the seek time of every request is calculated in advance in the queue, and when they are scheduled according to their calculated seek time. As a result, the request near the disk arm will get executed first. SSTF is certainly an improvement over FCFS as it decreases the average response time and increases the throughput of the system. It is a reasonable solution for a batch processing system. Sometimes, it does not ensure fairness because, with this scheduling, starvation is possible. This policy is generally not acceptable for interactive systems, and it leads to higher variances of response times. ExampleIn this case, the request is serviced according to the next shortest distance. Starting at 50, the next shortest distance would be 62 instead of 34 since it is only 12 tracks away from 62 and 16 tracks away from 34. The process would continue until all the processes are taken care of. For example, the next case would be to move from 62 to 64 instead of 34 since there are only 2 tracks between them and not 18 if it were to go the other way. Although this seems to be a better service because it moved all 236 tracks, it is not optimal. There is a great chance that starvation would occur, and this is because if there were many requests close to each other, the other requests would never be handled since the distance would always be greater. AdvantagesHere are the following advantages of the SSTF Disk Scheduling Algorithm, such as:
DisadvantagesSSTF Disk Scheduling Algorithm also has the following disadvantages, such as:
What is the LOOK Disk Scheduling Algorithm?LOOK algorithm is actually an improved version of the SCAN Algorithm. In this algorithm, the head starts the first request at one side of the disk and moves towards the other end by serving all requests in between. Unlike SCAN, the head, instead of going till the last track, goes till the last request, and then the direction is changed. Unlike SSTF, it doesn't serve the task request which is closest to the current position of the head or pointer. It is similar to the SCAN disk scheduling algorithm except for the difference that the disk arm, despite going to the end of the disk, goes only to the last request to be serviced in front of the head and then reverses its direction from there only. Thus it prevents the extra delay which occurred due to unnecessary traversal to the end of the disk. The main difference between the SCAN Algorithm and LOOK algorithm is:
ExampleConsider a disk with 200 tracks (0-199) and the disk queue having I/O requests in the following order: 98, 183, 40, 122, 10, 124, and 65. The current head position of the Read\Write head is 53 and will move in the right direction. Calculate the total number of track movements of the Read/Write head using the LOOK algorithm. Advantages of LOOK Disk Scheduling AlgorithmHere are the following advantages of the LOOK disk scheduling algorithm, such as:
Disadvantages of LOOK Disk Scheduling AlgorithmLook disk scheduling algorithm also has some disadvantages, such as:
Difference between SSTF and LOOK Disk Scheduling AlgorithmBelow are the following differences between SSTF and LOOK disk scheduling algorithm.
Next TopicVirtual vs Physical Address |