The First-Come, First-Served (FCFS) disk scheduling algorithm is a simple approach where disk I/O requests are serviced in the order they arrive. Requests are added to a queue and executed sequentially, without considering the position of the disk head or the proximity of requests. FCFS ensures that every request is eventually serviced, but it may not be efficient in terms of minimizing seek time or optimizing disk performance.
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.
First Come First Serve algorithm has a very simple logic, it executes the process requests one by one in the sequence they arrive. Thus, First Come First Serve is very simple and easy to understand and implement. In FCFS eventually, each and every process gets a chance to execute, so no starvation occur. Disadvantages – This scheduling algorithm is nonpreemptive, which means the process can’t be stopped in middle of execution and will run it’s full course. FCFS being a nonpreemptive scheduling algorithm, the short processes which are at the back of the queue have to wait for the long process at the front to finish The throughput of FCFS is not very efficient. FCFS is implemented on small systems only where input-output efficiency is not of utmost importance