Re: Using both clocks in s6-log and friends?

From: Laurent Bercot <>
Date: Sat, 29 Oct 2016 15:39:41 +0000

>While the requirement for timestamping and the internal implementation
>of skalibs favours the wall clock [1][2], I think it does not preclude
>programs from using the monotonic clock solely for internal
>which might make the clock skew issues less serious.

  It's definitely a possibility, but it would require some heavy
- typically, implementing a second set of iopause() primitives around
CLOCK_MONOTONIC. (And defaulting to CLOCK_REALTIME on systems that do
not provide CLOCK_MONOTONIC, I guess.) And using them, and juggling
both wallclock and stopwatch times.

  When you use several clocks in one process, you don't have a unique
view of what "the current time" is anymore. This is a bit annoying,
a lot of the skalibs functions assume that there's one true time source,
i.e. tain_now(). Generally it's a correct assumption. I'm not sure
whether the benefits of handling the special case of booting a machine
that doesn't know the time yet (so will require one time jump at some
point) are enough to balance the inconvenience of redesigning and
rewriting so much stuff.

Received on Sat Oct 29 2016 - 15:39:41 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC