FCFS (First-Come-First-Serve) Disk Scheduling Algorithm
FCFS (First-Come-First-Serve) is the simplest disk scheduling algorithm among all the scheduling algorithms. In the FCFS disk scheduling algorithm, each input/output request is served in the order in which the requests arrive. In this algorithm, starvation does not occur because FCFS address each request.It does not provide the fastest service.
Algorithm:
Let Request array represents an array storing indexes of tracks that have been requested in ascending order of their time of arrival. ‘head’ is the position of disk head.
Let us one by one take the tracks in default order and calculate the absolute distance of the track from the head.
Increment the total seek count with this distance.
Currently serviced track position now becomes the new head position.
Go to step 2 until all tracks in request array have not been serviced.
Video:
Advantages of FCFS Disk scheduling Algorithm:
The advantages of FCFS disk scheduling algorithm are:
In FCFS disk scheduling, there is no indefinite delay.
There is no starvation in FCFS disk scheduling because each request gets a fair chance.
Disadvantages of FCFS Disk Scheduling Algorithm:
The disadvantages of FCFS disk scheduling algorithm are:
FCFS scheduling is not offered as the best service.