RR(Round Robin) process scheduling algorithms question

Here are 30 questions on RR(Round Robin) process scheduling algorithms . Each question is presented in a table format, followed by the solution with Gantt charts, average turnaround time (TAT), and average waiting time (WT).

Question 12: find the average Turn Around Time and Waiting Time of following processes using RR(Round Robin) process scheduling algorithm? Consider the following processes with their Arrival Time, Burst Time, and Priority (take Quantum Time = 1.0)

Process Arrival Time Burst Time
P1 0 4.5
P2 2 0.5
P3 3 6
P4 4 2
P5 4 1
P6 6 3.5
P7 10 1
P8 11 3

Solution:

Given Time Quantum: 1.0

Formulas:

Gantt Chart

| P1(0-2)| P2(2-2.5) | P1(2.5-3.5) | P3(3.5-4.5) | P1(4.5-5.5) | P4(5.5-6.5) | P5(6.5-7.5) | P3(7.5-8.5) | P1(8.5-9) | P6(9-10) | P4(10-11) | P3(11-12) | P7(12-13) | P6(13-14) | P8(14-15) | P3(15-16) | P6(16-17) | P8(17-18) | P3(18-19) | P6(19-19.5) | P8(19.5-20.5) | P3(20.5-21.5)

Calculation:

Process Arrival Time Burst Time Completion Time Turnaround Time Waiting Time
P1 0 4.5 9 9 - 0 = 9 9 - 4.5 = 5.5
P2 2 0.5 2.5 2.5 - 2 = 0.5 0.5 - 0.5 = 0
P3 3 6 21.5 21.5 - 3 = 18.5 18.5 - 6 = 12.5
P4 4 2 11 11 - 4 = 7 7 - 2 = 5
P5 4 1 7.5 7.5 - 4 = 3.5 3.5 - 1 = 2.5
P6 6 3.5 19.5 19.5 - 6 = 13.5 13.5 - 3.5 = 10
P7 10 1 13 13 - 10 = 3 3 - 1 = 2
P8 11 3 20.5 20.5 - 11 = 9.5 9.5 - 3 = 6.5

Average Turnaround Time = (9 + 0.5 + 18.5 + 7 + 3.5 + 13.5 + 3 + 9.5) / 8 = 8.0625

Average Waiting Time = (5.5 + 0 + 12.5 + 5 + 2.5 + 10 + 2 + 6.5) / 8 = 5.5