tor 2026-02-12 klockan 17:34 +0100 skrev Bertho Stultiens:
> 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).
If done right result should always be positive if it is an increasing provided 
counter is checked more often than ~24½
days.

Calculations are probably best tested write a small "hello world" type program 
there a few calculations around the wrap
point is calculated.

Nicklas Karlsson



_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to