Hi,

I have encountered a problem, on version 4.11 of the library, where a timer 
started expired prior to its intended expiry time.

This happened because time_update() is not called by ev_timer_start() prior to 
calculating the expiry timestamp, which in cases where a timer is started after 
a long processing time during a loop iteration, results in ev_timer_start() 
using an old time instead of the current one.

In cases where the system is under heavy load (a prevalent case in embedded 
systems), this problem can manifest even if the iteration processing time prior 
to setting the timer is in theory short.

The fix I propose is to have ev_timer_start() call time_update() before 
calculating the expiry timestamp (patch attached).

I would be glad to know what are your thoughts on this issue, and whether this 
fix is needed and makes sense.

Thanks,
Aviv

Attachment: libev-time-update-on-timer-start.patch
Description: libev-time-update-on-timer-start.patch

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

Reply via email to