Open In App

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.

C-SCAN Disk Scheduling Algorithm

The C-SCAN algorithm, also known as the Circular Elevator algorithm is the modified version of the SCAN algorithm. In this algorithm, the head pointer starts from one end of the disk and moves towards the other end, serving all requests in between. After reaching the other end, the head reverses its direction and goes to the starting point. It then satisfies the remaining requests, in the same direction as before. Unlike SSTF, it can handle requests only in one 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 the right direction. Calculate the total number of track movements of the Read/Write head using the C-SCAN algorithm. Total head movements,



= (65-53)+(98-65)+(122-98)+(124-122)+(183-124)
+(199-183)+(199-0)+(10-0)+(40-10)
= 395

Algorithm of C-SCAN

Advantages of C-SCAN

Disadvantages of C-SCAN

SSTF Disk Scheduling Algorithm

SSTF stands for Shortest Seek Time First, as the name suggests it serves the request which is closest to the current position of head or pointer. In this algorithm, direction of  the head pointer matters a lot. If there occurs a tie between requests, then the head will serve the request in its ongoing direction. Unlike C-SCAN, SSTF algorithm is very efficient in total seek time. 

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 

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

Algorithm of SSTF

Advanatages of SSTF

Disadvantages of SSTF

Difference between C-SCAN and SSTF Disk Scheduling Algorithm

C-SCAN

SSTF

C-SCAN algorithm services the requests only in one direction

SSTF algorithm can handle the requests in both directions.

This algorithm causes more seek time as compared to SSTF

In SSTF algorithm, there is an overhead of finding closest request.

Performance of C-SCAN is far better than SSTF.

Whereas SSTF lags in performance.

C-SCAN algorithm provides low variance in average waiting time and response time.

Whereas SSTF provides high variance in average waiting time and response time.

C-SCAN algorithm will never cause starvation to any requests.

SSTF algorithm can cause starvation.

Frequently Asked Question on C-SCAN and SSTF – FAQs

Whose performance is best ?

The performance of C-SCAN is better then SSTF.

Can C-SCAN Algorithm helps in preventing Starvation?

Yes, C-SCAN Algorithm helps in preventing algorithm because it gives guarantee that all requests will be serviced.

Whether SSTF is suitable for minimizing disk arm movement?

Yes, SSTF is helpful in minimizing disk arm movement and it also helps in reducing seek time.

What kind of risk does the SSTF disk scheduling algorithm carry?

The problem occurs when both the disk controller and the host operation system both uses it, causing conflict scheduling.


Article Tags :