Open In App

Difference between FCFS and C-SCAN disk scheduling algorithm

Improve
Improve
Like Article
Like
Save
Share
Report

1. FCFS Disk Scheduling Algorithm :
FCFS stands for First come first serve, this algorithm entertains the task in the order they arrived in the disk queue. It is the simplest and easy to understand disk scheduling algorithm. In this the head or pointer moves in the direction in which the task arrives and moves till all request is served. However, FCFS algorithm has more fair policy of handling upcoming requests.

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. Calculate the total number of track movements of Read/Write head using FCFS algorithm.

Total head movements,

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

2. C-SCAN Disk Scheduling Algorithm :
C-SCAN algorithm, also known as Circular Elevator algorithm is the modified version of SCAN algorithm. In this algorithm, the head pointer starts from one end of disk and moves towards the other end, serving all requests in between. After reaching the other end, the head reverse its direction and go to the starting point. It then satisfies the remaining requests, in same direction as before. C-SCAN is one of the best disk scheduling algorithm.

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 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



Difference between FCFS and C-SCAN Disk Scheduling Algorithm :

S.No. FCFS DISK SCHEDULING ALGORITHM C-SCAN DISK SCHEDULING ALGORITHM
1 FCFS is inefficient in seek movements. Whereas C-SCAN is very efficient in seek movements.
2 FCFS cause more average waiting time and response time. But C-SCAN cause less average response time and waiting time.
3 In above example of FCFS, the head starts from 53 and serves the requests in the order of their arrival in disk queue. In the above example of C-SCAN algorithm, the head moves from 53, serves all requests in right direction till it reaches the other end. Then it jumps to the opposite end and serves remaining requests in right direction only.
4 In FCFS algorithm there is decrement in Throughput. Here there is increment in Throughput.
5 FCFS doesn’t cause starvation to any request, but request can experience Convoy effect. In C-SCAN algorithm neither the requests suffers starvation nor Convoy effect.
6 FCFS algorithm is easy to understand and implement. The performance of C-SCAN algorithm is far better than FCFS algorithm.


Last Updated : 04 Sep, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads