Algorithm of SSTF
- Step 1: Let an array containing the indexes of the requested tracks be represented by the Request array. “head” refers to the disk head’s location.
- Step 2: Determine each track’s positive separation from the head in the request array.
- Step 3: Select a track with a minimal distance from the head from the specified array that hasn’t been accessed or serviced yet.
- Step 4: Using this distance, increase the total number of seeks.
- Step 5: The head position is now the currently serviced track position.
- Step 6: Repeat step 2 up until the request array’s last track is unserviced.
Difference Between C-SCAN and SSTF Disk Scheduling Algorithm
In C-SCAN Algorithm it is necessary to take into account the direction, i.e., larger or smaller value. This algorithm serves disk requests by moving towards their conclusion while SSTF is a secondary storage scheduling method that decides how the disk’s head and arm will move to fulfil read and write requests. In this article, you will discover the distinction between the SSTF and C-SCAN disk scheduling algorithms in this post. However, you must first understand the distinctions between the SSTF and C-SCAN disk scheduling algorithms.