Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate average waiting time of Round robin scheduling?

Given this table : enter image description here

Those are the time lines (time slice = 4) :

|p1|p1|p2|p3|p4|p5|p1|p2|p3|p4|p5|p2|p3|p4|p5|p2|p3|p4|p5|p2|p3|p3|
0  4  8 12 16  20 24 28 32 36 40 44 48 52 56 60 64 68 69 72 75 79 80

Is there a simple way to calculate the average waiting time ?

Thanks

Note: that there are several finish times for each process !

Note2 : This question also involved priority algorithm as a side exercise , please disregard the priority column for the Round robin algorithm

like image 394
JAN Avatar asked Jul 25 '12 07:07

JAN


People also ask

How do you calculate average waiting time?

In a stable system, the average arrival rate to a system will equal the average exit rate for the system. Little's Law says that the average length of a line (L) is the product of the waiting time in line (W) times the throughput to the system (Lambda). That is, L = Lambda*W.

How is round robin calculated?

To determine the number of games for a single round robin tournament, as seen above, use the following formula, N x (N-1)/2. With a tournament of 6 teams, the calculation would be: 6 x (6-1)/2 = 6 x 5/2 = 30/2 = 15 games.


1 Answers

You can calculate Waiting time by drawing Gantt chart so waiting time of ith process is equal to Completion time - (Arrival time + Burst time ) .

like image 123
user3919801 Avatar answered Oct 09 '22 18:10

user3919801