Standalone mode and EV_USE_REALTIME
Greg Hudson
ghudson at MIT.EDU
Fri Sep 9 16:59:06 CEST 2011
On Fri, 2011-09-09 at 04:45 -0400, Marc Lehmann wrote:
> EV_STANDALONE is documented to not rely on autoconfig, but instead on a
> manually provided configuration. It seems to me that if you want to avoid
> using realtime calls you can just define EV_USE_REALTIME to 0 in your
> custom config.
>
> If this somehow doesn't work for you, then I'd be interested to hear why.
It works fine, and you're correct that EV_USE_REALTIME's default is
documented. I was thrown off by this statement in the documentation:
In standalone mode, libev will still try to automatically deduce
the
configuration, but has to be more conservative.
and by the fact that EV_USE_REALTIME's default is unaffected by
EV_FEATURE_OS. It just seems a little incongruous to the other
deductions made by ev.c in standalone mode, which is why I asked whether
it was intended.
Also, the documentation of EV_USE_MONOTONIC has some text about needing
to link against librt, when this dependency appears to arise from
EV_USE_REALTIME, not EV_USE_MONOTONIC.
> clock_gettime is rather important for timekeeping purposes, so
> should be provided if possible.
I guess, but unless EV_USE_MONOTONIC is also deduced (which depends on
EV_FEATURE_OS and _POSIX_MONOTONIC_CLOCK in unistd.h), I think you wind
up with a dependency on librt for no benefit, per this text:
This effectively replaces C<gettimeofday> by
C<clock_get(CLOCK_REALTIME, ...)> and will not normally affect
correctness.
More information about the libev
mailing list