Here, criteria for scheduling in Gannt chart is total CPU Brust time if Process in ready state, not in I/O queue (I/o brust).
During design, Gantt chart keeps regulary update the remaining CPU burst time of process for criteria.
Process |
Completion time |
Turn Around Time(TAT) |
Waiting time(TAT- CPU brust time) |
P1 |
7 |
7 |
1 |
P2 |
8 |
7 |
5 |
P3 |
13 |
9 |
5 |
P1 |
P2 |
P1 |
P1 |
P1 |
P1 |
P2 |
P3 |
---- |
P3 |
|
|
|
0 1 2 4 5 6 7 8 11 12 13
Gantt Chart
Average waiting time = (1+5+5)/3 = 11/3
Between 11 to 12 unit time the CPU is in idle state.
Note: If you are able to make a correct Gantt chart, you solve any complex question easily.