nearly-tickless-tinc
Guus Sliepen
guus at tinc-vpn.org
Thu Jun 2 21:45:18 CEST 2011
On Thu, Jun 02, 2011 at 10:43:43AM +0200, Loïc Grenié wrote:
> > Well, it is not so critical, and the problem is only with kernels that are more
> > than five years old.
>
> tincd is not tickless anyway: there is a tick for keepalive, that means that
> signal handling will be at most delayed.
Indeed. So let's ignore racy pselect()s.
> > Hm, in this case it is better to explicitly use #ifdef ... #else ... #endif in
> > the main loop, instead of #defining tinc_pselect and friends. With the former
> > it is more clear what happens.
>
> Here you go !
By "Here you go", did you mean there should have been a patch attached to the
email? :)
> It is probably a good idea to also change time comparison: with this
> patch "now" is evaluated after pselect(), thus with code like this:
>
> timeout = now+1;
> [... pselect() lasting 1s ... ]
> if (timeout < now) {
> contional code
> }
>
> conditional code will not get executed. It would be if comparison were
> timeout <= now (the instruction "next_event++;" in the patch would
> also disappear). I can take care of it.
now = time(NULL) should indeed by right after pselect(). Using <= seems better
as well.
From the patch in the previous email:
> + if(next_event <= now || sighup || sigalrm)
It shouldn't be necessary to check for sighup or sigalrm at that point; if they
are set there then surely pselect() will return with EINTR immediately anyway.
But now I'm just nitpicking.
--
Met vriendelijke groet / with kind regards,
Guus Sliepen <guus at tinc-vpn.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://www.tinc-vpn.org/pipermail/tinc-devel/attachments/20110602/6c52c388/attachment.pgp>
More information about the tinc-devel
mailing list