The Wayback Machine - https://web.archive.org/web/20240703074649/https://www.geeksforgeeks.org/difference-between-fcfs-and-sstf-disk-scheduling-algorithm/
Open In App

Difference between FCFS and SSTF Disk Scheduling Algorithm

Last Updated : 01 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

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
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 req
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 write requests. In this article, you will discover the
5 min read
Difference Between SSTF and C-LOOK Disk Scheduling Algorithm
The secondary storage scheduling algorithm known as SSTF decides how the disk's head and arm will move in response to read and write requests while in C-SCAN the head services request only in one direction(either left or right) until all the requests in this direction are not serviced and then jumps back to the farthest request in the other directi
7 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 and moves till all request is served. However, th
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 arrives and moves till all request is served. However, F
3 min read
Program for SSTF Disk Scheduling Algorithm
Given an array of disk track numbers and initial head position, our task is to find the total number of seek operations done to access all the requested tracks if Shortest Seek Time First (SSTF) is a disk scheduling algorithm is used. The basic idea is the tracks that are closer to the current disk head position should be serviced first in order to
10 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 and hence we can say that FCFS has a fair policy. Ex
3 min read
FCFS Disk Scheduling Algorithms
Prerequisite: Disk scheduling algorithms.Given an array of disk track numbers and initial head position, our task is to find the total number of seek operations done to access all the requested tracks if First Come First Serve (FCFS) disk scheduling algorithm is used. First Come First Serve (FCFS) FCFS is the simplest disk scheduling algorithm. As
6 min read
Difference between First Come First Served (FCFS) and Round Robin (RR) Scheduling Algorithm
First Come First Served Scheduling Algorithm: First Come First Served (FCFS) is the simplest and non-preemptive scheduling algorithm. In First Come First Served (FCFS), the process is allocated to the CPU in the order of their arrival. A queue data structure is used to implement the FCFS scheduling algorithm. The process which is at the head of the
2 min read
Difference between Seek Time and Disk Access Time in Disk Scheduling
Seek Time: A disk is divided into many circular tracks. Seek Time is defined as the time required by the read/write head to move from one track to another. Example, Consider the following diagram, the read/write head is currently on track 1. Now, on the next read/write request, we may want to read data from Track 4, in this case, our read/write hea
3 min read