CONCEPT - First Come First Serve (FCFS)



First Come First Serve(FCFS)

FCFS is the simplest and the easiest CPU scheduling algorithm. In FCFS, the processes is managed with a FIFO queue. The processes which requests the CPU first get the CPU allocation first. Non-preemptive scheduling algorithms is supported by FCFS method. Let us understand this with the help of an example.

    Advantages:

  • It is simple and very easy to understand
  • Since it offers time, it is more predictable

  • Disadvantages:

  • Short and important jobs(process) may have to wait for a long time
  • Average waiting time and turn around time is often quite long and it doesnot guarantee good response time service
  • It is not ideal technique for time-sharing systems and also not very efficient.

Example:


In this example we have three processes P1, P2, and P3 having CPU time as 24, 3, and 4 respectively.
Here, we have assumed arrivial time as 0, so turn around and completion times are same.

Here, Completion Time for P1, P2 andd P3 are 24, 27 and 31 respectively.
In FCFS, Turn Around Time = Completion Time - Arrivial time
Waiting Time = Turn Around Time - Burst Time