On Mon, Dec 17, 2018 at 08:18:42AM +0100, Claudio Jeker wrote: > On Sun, Dec 16, 2018 at 04:58:35PM -0600, Scott Cheloha wrote: > > On Sun, Dec 16, 2018 at 06:45:39PM +0100, Claudio Jeker wrote: > > > Simple conversion of timeout_add(X, Y * hz) to timeout_add_sec(X, Y) > > > and timeout_add(X, tvtohz(&tv)) to timeout_add_tv(X, &tv). > > > > Remember that tvtohz(9) adds an extra tick where timeout_add_tv(9) > > does not. That doesn't look to be a problem here, but it doesn't hurt > > to ask. > > Good point. Default settings will be OK since carp has a default timeout > of 1sec but if advbase is 0 and advskew < 256 / HZ (3 on GENERIC) then > the timeout will be immediate.
Should have finished my coffee before hitting send. The code currently will always sleep for at least next tick since if tv_sec is 0 then tv_usec is always != 0 and therefore internally it will sleep for 1. > > > OK? > > > > As long as you don't mind those carp timeouts firing a tick sooner, > > ok cheloha@. > > I would prefer to move on with this since having less code depend on HZ is > better. -- :wq Claudio