Open In App

Difference between SSTF and LOOK disk scheduling algorithm

Last Updated : 02 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

1. SSTF disk scheduling algorithm :
SSTF stands for Shortest Seek Time First. As the name specify, this algorithm serves the task request which is closest to current position of head or pointer. Here, the direction of head plays an vital role in determining total head movement. If there occurs a tie between requests then the head will serve the request which encounters it, in its ongoing direction.

Example –
Consider a disk with 200 tracks (0-199) and the disk queue having I/O requests in the following order as follows: 98, 183, 40, 122, 10, 124, 65. The current head position of the Read\Write head is 53 and will move in Right direction. Calculate the total number of track movements of Read/Write head using SSTF algorithm.

Total head movements,

= (65-53)+(65-40)+(40-10)+(98-10)
              +(122-98)+(124-122)+(183-124)
= 240 

2. LOOK disk scheduling algorithm :
Look Algorithm is actually an improves version of SCAN Algorithm. In this algorithm, the head starts the first request at one side of disk and moves towards the other end by serving all requests in between. Unlike SCAN, in this the head instead of going till last track, it goes till last request and then direction is changed. Unlike SSTF, it doesn’t serves the task request which is closest to current position of head or pointer.

Example –
Consider a disk with 200 tracks (0-199) and the disk queue having I/O requests in the following order as follows: 98, 183, 40, 122, 10, 124, 65. The current head position of the Read\Write head is 53 and will move in Right direction . Calculate the total number of track movements of Read/Write head using LOOK algorithm.

Total head movements,

= (65-53)+(98-65)+(122-98)
              +(124-122)+(183-124)+(183-40)+(40-10)
= 303 



Difference between SSTF and LOOK disk scheduling algorithm :

LOOK SCHEDULING ALGORITHM SSTF SCHEDULING ALGORITHM
1. The performance of LOOK is better than SSTF. SSTF lags in performance.
2. LOOK results in increased total seek time. It reduces total seek time as compared to LOOK.
3. It provides low variance in average waiting time and response time. This algorithm provides high variance average response time and waiting time.
4. As shown in above example, direction of head gets reversed when it serves the last request in one direction. But here, direction of head plays an important role, in order to break tie between requests.
5. In this algorithm, there is an overhead for finding end request. Here, there is an overhead for finding out closest request.
6. LOOK does not cause starvation to any request. Here, the request which are far from head will suffer starvation.
7. LOOK algorithm can handle requests more effectively than SSTF. Here handling of request is not so good as compared to LOOK algorithm.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads