On 2/12/26 5:08 PM, Peter Wallace wrote:
Is there anybody who has a LinuxCNC instance that runs for more than
(multiples of) about 49 days at a time (that is for a 1kHz servo-thread)?
There is a race condition when a 32-bit heartbeat counter wraps. It
can only be hit every ~49 days within a time window of one servo-
thread period (usually 1ms). So, the chance of hitting the race is
very remote and can only be hit if you are actively tracking the
heartbeat variable, which usually nobody does.
So, does it need to be taken care of or should it be considered academic?
I have run hardware tests for up to 3 months or so.
That is nice!
What would the wrap of the heratbeat counter do?
It could cause the difference calculation of two temporally separated
values of the heartbeat counter to result in the wrong result (a
negative difference instead of a positive one).
I have code in the new version on linuxcncrsh that can wait for a
servo-thread period to work around an inherent race between real-time
and non-real-time (just after homing getting teleop mode status).
To hit the problem you need to send a special wait command and it needs
to be executed exactly one beat before the heartbeat wrap. As said, a
difficult proposition but technically not impossible.
--
Greetings Bertho
(disclaimers are disclaimed)
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers