A set of processes along with their burst time in milliseconds is given below. The processes should execute in First Come First Served order. Assume that the quantum (q) is 3:
Process Burst Time
P1 22
P2 4
P3 12
P4 15
P5 2
Find the average waiting time using the Round Robin algorithm. Round your answer to 2 decimal places
A set of process is given with the burst time in milliseconds. the proceaa will execute First come First serve process and the quantum time |q| is 3 ms.
Round Robin Scheduling algorithm is used in Multitasking operating system and Time sharing basically based on First Come First Serve.
Process |
Burst Time ( ms) |
P1 |
22 |
P2 |
4 |
P3 |
12 |
P4 |
15 |
P5 |
2 |
The quantum |q| is 3 millisecond and the arrival time is 0. Draw the Gantt Chart for the process to find out the average waiting time and turn around time.
P1 gets the CPU at the 0 ms so when P1 gets the CPU it has to execute the how long the burst time of the P1 i.e 6 22 ms but we need to allow it to excute only equals to the time quantum |q| which is 3 ms
Gantt Chart :
0 3 6 9 12 14 17 18 21 24 27 30 33 36 39 42
P1 |
P2 |
P3 |
P4 |
P5 |
P1 |
P2 |
P3 |
P4 |
P1 |
P3 |
P4 |
P1 |
P3 |
P4 |
42 45 48 51 54 55
P1 |
P4 |
P1 |
P1 |
P1 |
Method to find out the waiting time
Turnaround Time = Complition Time – Arriving Time
Wating Time = Turnaround time – Burst time
Process |
Complition Time (ms) |
Turn around Time (ms) |
Waiting Time (ms) |
P1 |
55 |
55 – 0 = 55 |
55 – 22 = 33 |
P2 |
18 |
18 – 0 = 18 |
18 – 4 = 14 |
P3 |
39 |
39 – 0 = 39 |
39 – 12 = 27 |
P4 |
48 |
48 – 0 = 48 |
48 – 15 = 33 |
P5 |
14 |
14 – 0 = 14 |
14 – 2 = 12 |
Average Turnaround time is
( 55 + 18 + 39 + 48 + 14 ) / 5
34.80 ms
Average Waiting Time is
( 33 + 14 + 27 + 33 + 12 ) / 5
23.80 ms
Get Answers For Free
Most questions answered within 1 hours.