First Come First Served Process Scheduling FCFS in operating systems

First Come First Served Scheduling (FCFS)

Process arrives first always execute first.

FCFS is non-preemptive scheduling algorithm so processes priority does not matter.

  • FCFS is pre-emptive scheduling algorithm
  • If process first arrived is a big process with a high burst time, then other processes with less burst time need to wait.
  • Average wait time is high.
  • Easy to implement.
  • Easy to understand.
Process Burst Time Arrival
P1 4 2nd
P2 2 3rd
P3 8 1st
P4 3 4th

Gantt Chart of First Come, First Served (FCFS) Scheduling

FCFS Algo in os
Figure: FCFS.
Process Waiting Time
P1 8
P2 12
P3 0
P4 14

Average Wait Time: (0+8+12+14) / 4 = 8.5

How to calculate turn around time?

TurnAroundTime=BurstTime+WaitingTime.

First Come First Served (FCFS) Program in C++