Menu

#3 Rate Limiter calculate method flaw.

open
larytet
5
2005-02-03
2005-02-03
princejer
No

In the following code

do
{
int byteRate = (int)(bytes / (timeout * size));
if (byteRate >= bandwidth)
break;
int idx = r.nextInt(size); // spread bursts randomly
required[idx]++; // over the scheduler
bytes += 1;
}
while (true);

break shall occur always because bytes is in reality a
product of timeout, size and bandwidth.

Discussion


Log in to post a comment.