Hi,

Documentation of libev's ev_timer states that it will happen only
after the timeout, and not at. Currently it introduces a very
interesting problem, because if there are ev_timers that have "at"
being equal to current time, then ev_loop will determine that
backend_poll timeout should be 0.0, which is likely to return almost
immediately, and if there are no other activations in the mean time
and clock has a very poor resolution (in my case it was ~15ms) then
ev_loop will cause 100% cpu load with no callbacks being called,
effectively wasting a lot of resources just to catch that "next
timeslice".

If I change "<" with "<=" in timers_reify, then it gets rid of
unnecessary looping, but it seems like it might have been done to work
around something, maybe? It so, what was it and is it still necessary?

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to