#1 2026-10-20 10:29:31

Mo0211
Member
Registered: 2018-12-30
Posts: 42

Clock redirection in mormot2

Hi,
I found a clock redirection in mormot.core.os.posix.inc that changes CLOCK_REALTIME and CLOCK_MONOTONIC to their *_FAST variants before calling libc’s clock_gettime.
In our Linux/FPC build, the RTL uses clock readings to calculate absolute deadlines for event waits. Replacing the requested clock ID can make the timestamp use a different clock source or resolution than the wait expects.
This appears to affect short timeouts in particular: a deadline can already be expired when the wait checks it.

Is it possible to not use this redirection in any way or to have a parameter to use the normal version?

Thank you for your feedback!

Offline

#2 2026-10-21 16:29:00

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,622
Website

Re: Clock redirection in mormot2

You can disable those redirections by defining the proper conditional in the package.

Offline

Board footer

Powered by FluxBB