written 2.9 years ago by | modified 17 months ago by |
Draw gantt chart, calculate the average waiting time & average turn-around time if the processes are scheduled using: FCFS algorithm SJF algorithm (preemptive)
written 2.9 years ago by | modified 17 months ago by |
Draw gantt chart, calculate the average waiting time & average turn-around time if the processes are scheduled using: FCFS algorithm SJF algorithm (preemptive)
written 2.9 years ago by |
Turn Around Time = Process Completion Time – Process Arrival Time
Waiting time = Turn Around time – Burst time
Process | Arrival Time | Burst Time | Completion Time | Turn Around Time | Waiting Time |
---|---|---|---|---|---|
P1 | 0 | 6 | 6 | 6 – 0 = 6 | 6 – 6 = 0 |
P2 | 1 | 2 | 8 | 8 – 1 = 7 | 7 – 2 = 5 |
P3 | 2 | 5 | 13 | 13 – 2 = 11 | 11 – 5 = 6 |
P4 | 3 | 6 | 19 | 19 – 3 = 16 | 16 – 6 = 10 |
P5 | 7 | 1 | 20 | 20 – 7 = 13 | 13 – 1 = 12 |
Average Turn Around Time = (6 + 7 + 11 + 16 + 13)/5 = 10.6 ms
Average Waiting time = (0 + 5 + 6 + 10 +12)/5 = 6.6 ms
Process | Arrival Time | Burst Time | Completion Time | Turn Around Time | Waiting Time |
---|---|---|---|---|---|
P1 | 0 | 6 | 6 | 6 – 0 = 6 | 6 – 6 = 0 |
P2 | 1 | 2 | 8 | 8 – 1 = 7 | 7 – 2 = 5 |
P5 | 7 | 1 | 9 | 9 – 7 = 2 | 2 – 1 = 1 |
P3 | 2 | 5 | 14 | 14 – 2 = 12 | 12 – 5 = 7 |
P4 | 3 | 6 | 20 | 20 – 3 = 17 | 17 – 6 = 11 |
Average Turn Around Time = (6 + 7 + 2 + 12 + 17)/5 = 8.8 ms
Average Waiting time = (0 + 5 + 1 + 7 + 11)/5 = 4.8 ms
written 2.9 years ago by |
FCFS algorithm
Gantt Chart
calculate the average waiting time & average turn-around time
Average turn-around time
= (6+7+11+16+13)/5
= 53/5
= 10.6
Average turn-around time = 10.6
Average waiting time
= (0+5+6+10+12)/5
=(33)/5
=6.6
Average waiting time =6.6
SJF algorithm (non-preemptive)
Gantt Chart
calculate the average waiting time & average turn-around time
Average turn-around time
= (6+7+2+12+17)/5
= 44/5
= 8.8
Average turn-around time = 8.8
Average waiting time
= (0+5+1+7+11)/5
=(24)/5
=4.8
Average waiting time =4.8