FCFS Scheduling
Â
In FCFS Scheduling,
 The process which arrives first in the ready queue is firstly assigned the CPU.
 In case of a tie, process with smaller process id is executed first.
 It is always nonpreemptive in nature.
Â
Advantages
Â
 It is simple and easy to understand.
 It can be easily implemented using queue data structure.
 It does not lead to starvation.
Â
Disadvantages
Â
 It does not consider the priority or burst time of the processes.
 It suffers from convoy effect.
Â
Convoy EffectIn convoy effect,

Â
PRACTICE PROBLEMS BASED ON FCFS SCHEDULING
Â
Problem01:
Â
Consider the set of 5 processes whose arrival time and burst time are given below
Â
Process Id  Arrival time  Burst time 
P1  3  4 
P2  5  3 
P3  0  2 
P4  5  1 
P5  4  3 
Â
If the CPU scheduling policy is FCFS, calculate the average waiting time and average turn around time.
Â
Solution
Â
Gantt Chart
Â
Â
Here, black box represents the idle time of CPU.
Â
Now, we know
 Turn Around time = Exit time â€“ Arrival time
 Waiting time = Turn Around time â€“ Burst time
Â
Also read Various Times of Process
Â
Process Id  Exit time  Turn Around time  Waiting time 
P1  7  7 â€“ 3 = 4  4 â€“ 4 = 0 
P2  13  13 â€“ 5 = 8  8 â€“ 3 = 5 
P3  2  2 â€“ 0 = 2  2 â€“ 2 = 0 
P4  14  14 â€“ 5 = 9  9 â€“ 1 = 8 
P5  10  10 â€“ 4 = 6  6 â€“ 3 = 3 
Â
Now,
 Average Turn Around time = (4 + 8 + 2 + 9 + 6) / 5 = 29 / 5 = 5.8 unit
 Average waiting time = (0 + 5 + 0 + 8 + 3) / 5 = 16 / 5 = 3.2 unit
Â
Problem02:
Â
Consider the set of 3 processes whose arrival time and burst time are given below
Â
Process Id  Arrival time  Burst time 
P1  0  2 
P2  3  1 
P3  5  6 
Â
If the CPU scheduling policy is FCFS, calculate the average waiting time and average turn around time.
Â
Solution
Â
Gantt Chart
Â
Â
Here, black box represents the idle time of CPU.
Â
Now, we know
 Turn Around time = Exit time â€“ Arrival time
 Waiting time = Turn Around time â€“ Burst time
Â
Process Id  Exit time  Turn Around time  Waiting time 
P1  2  2 â€“ 0 = 2  2 â€“ 2 = 0 
P2  4  4 â€“ 3 = 1  1 â€“ 1 = 0 
P3  11  11 5 = 6  6 â€“ 6 = 0 
Â
Now,
 Average Turn Around time = (2 + 1 + 6) / 3 = 9 / 3 = 3 unit
 Average waiting time = (0 + 0 + 0) / 3 = 0 / 3 = 0 unit
Â
Problem03:
Â
Consider the set of 6 processes whose arrival time and burst time are given below
Â
Process Id  Arrival time  Burst time 
P1  0  3 
P2  1  2 
P3  2  1 
P4  3  4 
P5  4  5 
P6  5  2 
Â
If the CPU scheduling policy is FCFS and there is 1 unit of overhead in scheduling the processes, find the efficiency of the algorithm.
Â
Solution
Â
Gantt Chart
Â
Â
Here, Î´ denotes the context switching overhead.
Â
Now,
 Useless time / Wasted time = 6 xÂ Î´ = 6 x 1 = 6 unit
 Total time = 23 unit
 Useful time = 23 unit â€“ 6 unit = 17 unit
Â
Efficiency (Î·)
= Useful timeÂ / Total Total
= 17 unit / 23 unit
= 0.7391
= 73.91%
Â
To gain better understanding about FCFS Scheduling,
Â
Next Article SJF Scheduling  SRTF Scheduling
Â
Get more notes and other study material of Operating System.
Watch video lectures by visiting our YouTube channel LearnVidFun.