0% found this document useful (0 votes)
15 views

Example of Round Robin Scheduling Algorithm

The document describes an example of the Round Robin scheduling algorithm applied to six processes with specified arrival and burst times. It details the execution order of the processes, the formation of the ready queue, and the calculation of average waiting and turnaround times. The average waiting time for the processes is calculated to be 11.33 units.

Uploaded by

nkhg179
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Example of Round Robin Scheduling Algorithm

The document describes an example of the Round Robin scheduling algorithm applied to six processes with specified arrival and burst times. It details the execution order of the processes, the formation of the ready queue, and the calculation of average waiting and turnaround times. The average waiting time for the processes is calculated to be 11.33 units.

Uploaded by

nkhg179
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Example of Round Robin Scheduling Algorithm

Consider the following 6 processes: P1, P2, P3, P4, P5, and P6 with their arrival time
and burst time as given below:

Q. What are the average waiting and turnaround times for the round-robin scheduling
algorithm (RR) with a time quantum of 4 units?

Process ID Arrival Time Burst Time


P1 0 5
P2 1 6
P3 2 3
P4 3 1
P5 4 5
P6 6 4

Ready Queue:
At first, In the ready queue, process P1 will be executed for a time slice of 4 units.
Since there are no processes initially, Process P1, with a burst time of 5 units, will be
the only process in the ready queue.

P1
5

Ready Queue:
Along with the execution of P1, four more processes, P2, P3, P4, and P5, arrive in the
ready queue. P1 will be added to the ready queue due to the remaining 1 unit.

P2 P3 P4 P5 P1
6 3 1 5 1

Ready Queue:
During the execution of P2, P6 arrived in the ready queue. Since P2 has not been
completed, P2 will be added to the ready queue.

P3 P4 P5 P1 P6 P2
3 1 5 1 4 2
Ready Queue:
Similarly, P3 and P4 have been completed, but P5 has a remaining burst time of 1
unit. Hence it will be added back to the queue.

P1 P6 P2 P5

1 4 2 1

Ready Queue:
The next processes, P6 and P2, will be executed. Only P5 will be left with 1 unit of
burst time.

P5

GANTT Chart:
The Gantt chart will look like this:

As we know,

Turn Around Time = Completion Time - Arrival Time


Waiting Time = Turn Around Time - Burst Time

Processes Arrival Time(AT) Burst Time(BT) Turn Around Time(TAT) Waiting Time(WT)

P1 0 5 17 12

P2 1 6 22 16
Processes Arrival Time(AT) Burst Time(BT) Turn Around Time(TAT) Waiting Time(WT)

P3 2 3 9 6

P4 3 1 9 8

P5 4 5 20 15

P6 6 4 15 11

Avg Waiting Time = (11+5+8+6+16+12)/6 = 68/6 = 11.33 units.

You might also like