[zeromq-dev] [Openpgm-dev] Re: Bug in rate control?

Martin Sustrik sustrik at 250bpm.com
Sun Dec 27 22:36:36 CET 2009

Steven McCoy wrote:
> 2009/12/27 Martin Sustrik <sustrik at 250bpm.com <mailto:sustrik at 250bpm.com>>
>     Calculating refill increment based on the time of last _successful_ call
>     to pgm_rate_check seems to solve the issue:
> Ah ok, although double precision math is already being used it's at 
> fractions of a second, it would be more accurate to calculate at the 
> millisecond first.
> I re-arranged the code to use the new_rate_limit variable earlier rather 
> than store and swap.

The patch fixes the problem. Thanks!

Still, shouldn't we consider calculating the increment based on last 
_successful_ call to pgm_rate_check? The point IMO is that the time 
difference between two successful calls to pgm_rate_check would depend 
only on the required rate limit and size of the data to send. It makes 
the algorithm completely independent of how often pgm_rate_check is 
called and thus prevents calculations with unreasonably low time 
intervals (zero in the worst case).


More information about the zeromq-dev mailing list