Difference between FCFS and SSTF Disk Scheduling Algorithm
Last Updated :
01 Jul, 2022
Prerequisite - Disk Scheduling Algorithms
1. FCFS Disk Scheduling Algorithm : First come first serve, as name suggest 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. FCFS provides more average waiting time and response time. 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. 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 somehow, we encounter a tie between requests then the head will serve the request in its ongoing direction. SSTF algorithm is very efficient in seek time as compared to FCFS.
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
Difference between FCFS and SSTF disk scheduling algorithm :
| FCFS SCHEDULING ALGORITHM | SSTF SCHEDULING ALGORITHM |
1. | FCFS is not efficient in seek movements. | SSTF is very effective/efficient in seek movements. |
2. | It results in increased total seek time. | It reduces the total seek time as compared to FCFS. |
3. | It provides more average waiting time and response time. | This algorithm provides less average response time and waiting time. |
4. | In this algorithm direction of head does not matters much, which we can clearly see in above example. | But here direction of head plays an important role, in order to break tie between requests and above example is a proof of it. |
5. | This algorithm is the easy to understand and implement. | Here, there is an overhead of finding out the closest request. |
6. | FCFS does not cause starvation to any request (but may suffer from Convoy effect.). | Here, the request which are far from head will suffer starvation. |
7. | In FCFS algorithm there is decrement in Throughput. | Here in SSTF there is increment in Throughput. |
Similar Reads
Difference between SSTF and LOOK disk scheduling algorithm Disk scheduling algorithms are used by operating systems to decide the order in which disk I/O requests are processed. Since disk access time is relatively slow, these algorithms aim to reduce the time it takes to read/write data by optimizing the movement of the disk arm.SSTF(Shortest Seek Time Fir
3 min read
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 writ
5 min read
Difference between FCFS and SCAN disk scheduling algorithms FCFS disk scheduling algorithm: As the name suggests, the FCFS Scheduling Algorithm processes requests in the sequential order in which they arrive in the disk queue. Even if a higher priority request arrives in the schedule later, FCFS will process the request in the order that they have arrived an
3 min read
Difference between FCFS and C-SCAN disk scheduling algorithm 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 arrive
3 min read
Difference between FCFS and C-LOOK disk scheduling algorithm 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
3 min read
Difference Between FCFS and SJF CPU Scheduling Algorithms CPU scheduling is a key part of how an operating system works. It decides which task (or process) the CPU should work on at any given time. This is important because a CPU can only handle one task at a time, but there are usually many tasks that need to be processed. In this article, we are going to
5 min read