[Libevent-users] Re: evtimer complains...

Niels Provos provos at citi.umich.edu
Sat Dec 9 20:08:16 EST 2006


The libevent API has never supported absolute times for timeouts.  If
they worked before then that was only by accident and never by
intention.  The switch to clock monotonic was made to support clock
resets.   So, personally, I am very surprised that absolute times ever
worked for you.

Is this something that should be documented more clearly in the man page?

Niels.

On 12/9/06, Phil Oleson <oz at nixil.net> wrote:
> Niels,
>
>         I've taken a little time time to look through my issue with
> evtimers.  Previously, Scott Lamb questioned my code using absolute
> time with evtimers, but I see no problem with this.  It used to work
> pre-1.2, and I've tracked the issue down to gettime() using
> CLOCK_MONOTONIC rather than CLOCK_REALTIME. When I've hacked libevent to
> use CLOCK_REALTIME, my test code works.  To me it seems that using
> CLOCK_MONOTONIC causes issues with calls to gettimeofday.  Was there
> any particular reason to have CLOCK_MONOTONIC as the arg to
> clock_gettime()?  I would just like to understand this better before
> I rewrite my application.
>
>         -Phil.
>
>


More information about the Libevent-users mailing list