In: Computer Science
What is the arrival time, completion time, burst time, turnaround time, and the waiting time of First Come First Serve (FCFS)?
Answer:----------------
First Come First Serve (FCFS):---------------
Arrival time:----- Time at which the process
arrives in the ready queue.
Completion time:---- Time at which process
completes its execution.
Burst time:---- Time required by a process for CPU
execution.
Turnaround time:---- The interval from the time
of submission of a process to the time of completion is the
turnaround time.Turnaround time is the sum of the periods spent
waiting to get into memory, waiting in the ready queue, executing
on the CPU, and doing I/O.
Turnaround Time = Completion Time - Arrival
Time
Waiting time :---- The amount of time that a
process spends waiting in the ready queue. Waiting time is the sum
of the periods spent waiting in the ready queue.
Waiting time = Turnaround time – Burst time
Waiting time = Completion time – Arrival time – Burst
Time
Example of FCFS :------------
Consider below table of three processes under FCFS .
Process | Arrival Time | CPU Burst Time |
P1 | 0 | 4 |
P2 | 0 | 4 |
P3 | 0 | 7 |
Below is the gantt chart of the problem :
P1 | P2 | P3 |
0------------------------4------------------------8----------------------15
Completion Time of P1 :-- 4
Completion Time of P2 :-- 8
Completion Time of P3 :-- 15
Turnaround Time of P1 :-- 4 - 0 = 4
Turnaround Time of P2 :-- 8 - 0 = 8
Turnaround Time of P3 :-- 15 - 0 = 15
Waiting Time of P1 :-- 4 - 4 = 0
Waiting Time of P2 :-- 8 - 4 = 4
Waiting Time of P3 :-- 15 - 7 = 8