First Come First Serve



Introduction

FCFS (First-Come-First-Serve) is the easiest 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.


Advantages

1. In FCFS disk scheduling, there is no indefinite delay.

2. There is no starvation in FCFS disk scheduling because each request gets a fair chance.


Disdvantages

1. FCFS scheduling is not offered as the best service.

2. In FCFS, scheduling disk time is not optimized.


Example

Suppose a disk contains 200 tracks (0-199) and the request queue contains track no: 93, 176, 42, 148, 27, 14,180. The current position of the read/write head is 55. Now we have to calculate the total number of track movements of read/write head using FCFS scheduling.


As mentioned in the following example, the disk contains 200 tracks, so we take a track line between 0 to 199. The current position of the read/write head is 55. So, we start from 55, then move read/write head in the FCFS order. When all the requests are addressed, then we calculate a total number of cylinders moved by the head.


fcfs img

Total Number of cylinders moved by the head = (176-55) + (176-42) + (148-42) + (148-14) + (180-14) = 121+134+106+134+166 = 661