[zeromq-dev] Monotonic clock ?
Pieter Hintjens
ph at imatix.com
Tue Oct 1 22:11:18 CEST 2013
Hi Julien,
Looks like you're right on both counts. Do you want to send a patch to fix this?
Here's our contribution process: http://zeromq.org/docs:contributing
Cheers
Pieter
On Tue, Oct 1, 2013 at 9:16 PM, julien tayon <julien at tayon.net> wrote:
> First Point
> https://github.com/zeromq/libzmq/blob/master/src/clock.cpp#L75
> Here I see you use monotonic clock
> But according to the man clock_gettime
> I read :
> CLOCK_MONOTONIC
> Clock that cannot be set and represents monotonic time since
> some unspecified starting point.
>
> CLOCK_MONOTONIC_RAW (since Linux 2.6.28; Linux-specific)
> Similar to CLOCK_MONOTONIC, but provides access to a raw
> hardware-based time that is not subject to NTP adjustments.
>
>
> Wouldn't it be possible that for linux you may have a bug that will appear
> during ntp adujstements?
> (PS I have a hard time to get a definition of in how CLOCK_MONOTONIC is
> affected on linux by NTP, it seems that they play with frequencies to adjust
> CLOCK_MONOTONIC thus clock monotonic is indeed monotonic but not a reliable
> source of comparable absolute time interval. )
>
>
> Second Point:
> according to a lot a redirection the type for seconds in _time_t is on linux
> struct timespec
> {
> __time_t tv_sec; /* Seconds. */
> long int tv_nsec; /* Nanoseconds. */
> };
>
> with according to the other headers :
> __STD_TYPE __TIME_T_TYPE __time_t; /* Seconds since the Epoch. */
> and
> #define __TIME_T_TYPE __SLONGWORD_TYPE
> thus __time_t is SLONGWORD
>
>
> https://github.com/zeromq/libzmq/blob/master/src/clock.cpp#L84
> the cast is made on uint64
> I guess SLONGWORD => Signed long word
> uint64 seems to be an unsigned.
>
> I was wondering if by any chance there is a wrong casting ... that could
> cause a bug in a mlillenium or two.
>
>
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list