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++

 

Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....
https://web.facebook.com/groups/2066136233601097/