In this blog we will learn about the difference between FCFS and SCAN Disk Scheduling Algorithms. Multiple I/O requests are scheduled because the Operating System has to repeatedly access the sectors to save data and sometimes to fetch data. To schedule the I/O requests that come at the disc, the operating system uses a disc scheduling mechanism. The operating system employs disc scheduling techniques to execute disc scheduling.
Many I/O requests may come from many processes, but the disk controller can only handle one I/O request at a time. As a result, further I/O requests must wait in a queue before being scheduled.
The operating system must effectively handle the hardware.
To shorten the time spent searching.
FCFS and SCAN Algorithms are the types of Disk scheduling algorithms. This article focuses on the difference between these two algorithms. So, first, let’s discuss them in detail.
FCFS scheduling algorithm
The FCFS scheduling algorithm is the most straightforward. It's a first-come, first-serve algorithm, as the name implies. The I/O requests are executed in this method in the order they come in the disc queue. Let's look at an example of this algorithm.
Example: Consider a disc queue with requests for I/O to blocks on cylinders 98, 183, 37, 122, 14, 124, 65, and 67. The read-write head is initially at cylinder number 53. We will now use the FCFS algorithm to serve these I/O requests.
The disc arm in the SCAN scheduling algorithm starts at one end of the disc and proceeds to the other end, servicing requests as it reaches each cylinder until it reaches the other end. The direction of head movement is reversed as soon as it reaches the opposite end, and the service continues. The head continuously glides back and forth over the disc, fulfilling requests.
Because the disc arm behaves similarly to an elevator in a building, the SCAN algorithm is also known as the ELEVATOR algorithm. It services all requests going up first, then reverse to service requests going down.
Example: Consider a disc queue with requests for I/O to blocks on cylinders 98, 183, 37, 122, 14, 124, 65, and 67. The read-write head is initially at cylinder number 53. We will now use the SCAN algorithm to serve these I/O requests.
Now let’s learn the differences between them using a comparison table.
FCFS scheduling algorithm
SCAN scheduling algorithm
The acronym FCFS stands for "First-Come, First-Served."
SCAN algorithm is also known as the Elevator algorithm.
The FCFS Scheduling Algorithm will process requests in the order received in the disk queue.
The SCAN Scheduling Algorithm processes requests in one direction until it reaches the disk's end, at which point the disc arm changes direction and begins servicing requests in the opposite order.
The FCFS algorithm has the lowest throughput among all the disc scheduling techniques.
The SCAN algorithm outperforms the FCFS scheduling algorithm in terms of throughput.
Requests are processed according to schedule by the FCFS algorithm, therefore, there are fewer chances of indefinite postponement.
It's possible that the request's location was just visited by the disc arm, resulting in a lengthy wait period.
Because it does not aim to optimize the seek time, the FCFS method has the longest average seek time of all the disc scheduling algorithms.
When compared to the FCFS scheduling algorithm, the SCAN algorithm has a substantially shorter average search time.
This concludes our topic on the difference between FCFS and SCAN scheduling algorithms in the Operating system. Let’s move on to the FAQs section.
Disc scheduling is needed because many I/O requests may come from many processes, but the disk controller can only handle one I/O request at a time. As a result, further I/O requests must wait in a queue before being scheduled. And the operating system must effectively handle the hardware.
What is the full form of FCFS?
FCFS stands for First Come, First Serve.
What is the FCFS scheduling algorithm?
The FCFS scheduling algorithm is the most straightforward. It's a first-come, first-serve algorithm, as the name implies. The I/O requests are executed in this method in the order they come in the disc queue.
What is the ELEVATOR algorithm?
The elevator algorithm is just another name for the SCAN scheduling algorithm.
Why is the disc scheduling mechanism used?
The operating system uses a disc scheduling mechanism to schedule the I/O requests that come at the disc.
Conclusion
In this article, we have extensively discussed the difference between FCFS and SCAN disk scheduling algorithms in operating systems. This article covers these two algorithms with their example and the comparison table.