FCFS ( First Come First Serve ) in Operating System
Question 1)
Process No. AT(Arrival Time) BT (Burst Time)
P1 0 4
P2 1 3
P3 2 1
P4 3 2
P5 4 5
Solution:- First Create a Gantt chart.Here given a Process
Criteria :- Arrival Time
Mode :- Non-Preemptive
AWT (Average Waiting time):-
Process No. AT(Arrival Time) BT (Burst Time)
P1 0 4
P2 1 3
P3 2 1
P4 3 2
P5 4 5
Solution:- First Create a Gantt chart.Here given a Process
Criteria :- Arrival Time
Mode :- Non-Preemptive
Here P1 process is starting time 0 and completion time is 4 because 4 is burst time.
Then,P2 starting time is 4 and completion time is 7 because 4+3=7 and 3 is a burst time of P2
Next , P3 is starting time is 7 and completion time is 8, because 7+1=8 and 1 is burst time of P3
Same here apply condition on P4 and P5.
Then,Next find out completion time , Turn around time , Waiting time and Average Waiting time.
CT = Completion time
TAT= Turn Around time
WT= Waiting time
AWT= Average Waiting time
CT :-
P1= 4
P2= 7
P3= 8
P4= 10
P5= 15
TAT:-
Formula :- TAT = CT - AT
TAT (P1) = 4 - 0 = 4
(P2) = 7 - 1 = 6
(P3) = 8 - 2 = 6
(P4) = 10 - 3 = 7
(P5) = 15 - 4 = 11
WT :-
Formula :- WT = TAT - BT
WT(P1) = 4 - 4 = 0
(P2) = 6 - 3 =3
(P3) = 6 - 1 =5
(P4) = 7 - 2 =5
(P5) = 11 - 5 = 6AWT (Average Waiting time):-
( 0 + 3 + 5 + 5 + 6 ) /5 = 19 /5 = 3.8
Processes AT BT CT TAT WT
P1 0 4 4 4 0
P2 1 3 7 6 3
P3 2 1 8 6 5
P4 3 2 10 7 5
P5 4 5 15 11 6
No comments