Consider the following set of processes, with the length of the CPU-burst time given in milliseconds:
Process Burst Time Priority
P1 5 4
P2 3 1
P3 1 2
P4 7 2
P5 4 3
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.
If nonpreemptive priority (a larger priority number implies a higher priority) is used, what is the average waiting time of these processes?
In the Non Preemptive Priority scheduling, Processes are scheduled according to their priority. higher priority process exexute first.
Given that larger priority number implies a higher priority, so higher priority process exexute first.
GANTT Chart :
P4 | P1 | P5 | P2 | P3 |
0 72 126 169 200 212
Turnaround Time=Completion Time - Arrival Time
Waiting Time=Turn Around Time - Burst Time
Process Id | Arival Time | Burst Time |
|
Turnaround Time | Waiting Time | |
P4 | 0 | 72 | 72 | 72 | 0 | |
P1 | 0 | 54 | 126 | 126 | 72 | |
P5 | 0 | 43 | 169 | 169 | 126 | |
P2 | 0 | 31 | 200 | 200 | 169 | |
P3 | 0 | 12 | 212 | 212 | 200 |
average waiting time=sum(Waiting Time)/(Number of process)
Sum(Waiting Time)=0+72+126+169+200
=567
Number of process=5
average waiting time=567/5
average waiting time=113.4
Get Answers For Free
Most questions answered within 1 hours.