New SHM layout from gpsd

2023-01-20 Thread Hal Murray via devel
The 31 bit idea seems strange/ugly to me. How did you decide to do it that way? Why is it better than 32 unsigned bits? Is there some case that works with 31 bits that breaks with 32? I think there is a case that works for 32 unsigned that doesn't work for 31. Consider code that gets upd

Re: New SHM layout from gpsd

2023-01-20 Thread James Browning via devel
> On 01/20/2023 2:11 AM PST Hal Murray wrote: > > > The 31 bit idea seems strange/ugly to me. How did you decide to do it that > way? It is either Richard's fault or, more likely, mine. I proposed replacing the current SHM, and I need to communicate better. My alternate had a shared half-era co

Re: New SHM layout from gpsd

2023-01-20 Thread Gary E. Miller via devel
Yo Hal! On Fri, 20 Jan 2023 02:11:29 -0800 Hal Murray wrote: > The 31 bit idea seems strange/ugly to me. How did you decide to do > it that way? For back compatibility. > Why is it better than 32 unsigned bits? Is there some case that > works with 31 bits that breaks with 32? Yeah, 2038. >

Re: Mutex and Atomic (was 64 bit time_t on 32 bit systems)

2023-01-20 Thread Gary E. Miller via devel
Yo Hal! On Thu, 19 Jan 2023 21:43:08 -0800 Hal Murray wrote: > g...@rellim.com said: > > Sadly, that no longer works on modern CPUs with out of order > > execution. Unless wrapped in a mutex, or atomic, and that is now a > > no-no. > > Do you have a good reference for that? Many ariticle on

New SHM

2023-01-20 Thread Hal Murray via devel
Your current code has 2 1/2 memory barriers. That's the same as my 2 counter proposal. As long as we are mucking in this area, should we take the opportunity and do a big jump and convert to a new way of doing things? Support old and new SHM until we can drop old. Use 2 counters, read onl

Re: New SHM

2023-01-20 Thread Gary E. Miller via devel
Yo Hal! On Fri, 20 Jan 2023 12:20:09 -0800 Hal Murray wrote: > Your current code has 2 1/2 memory barriers. That's the same as my 2 > counter proposal. I rather not take responsibility for the current code. Not mine. And gpsd only has 2 threads, while ntpd has just one. The next solution ne