Calculate the Average Waiting Time
CPU burst time points out the time, the process needs the CPU. The subsequent are the set of processes with their respective CPU burst time (in milliseconds).
Processes CPU-burst time
P1 10
P2 5
P3 5
Calculate or find out the average waiting time if the process arrived in the subsequent order:
(i) P1, P2 & P3 (ii) P2, P3 & P1
Ans: consider FCFS scheduling
Process Burst Time
P1 10
P2 5
P3 5
(i) Assume that the processes arrive in the order: P1 , P2 , P3
The Gantt Chart for the schedule is as follow:
![1721_Calculate the Average Waiting Time.png](https://www.expertsmind.com/CMSImages/1721_Calculate%20the%20Average%20Waiting%20Time.png)
Waiting time for P1 = 0; P2 = 10; P3 = 15
Average waiting time: (0 + 10 + 15)/3 = 8.33 unit of time
(ii)Assume that the processes arrive in the order P2, P3, P1.
The Gantt chart for the schedule is as follow:
![2376_Calculate the Average Waiting Time 1.png](https://www.expertsmind.com/CMSImages/2376_Calculate%20the%20Average%20Waiting%20Time%201.png)
Waiting time for P1 = 10; P2 = 0; P3 = 5
Average waiting time: (10 + 0 + 5)/3 = 5 unit of time.