New SHM

Gary E. Miller gem at rellim.com
Fri Jan 20 20:43:52 UTC 2023


Yo Hal!

On Fri, 20 Jan 2023 12:20:09 -0800
Hal Murray <halmurray at sonic.net> 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 needs to be multi0thread and multi-reader freindly.

> 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?

We have to do both.  Maintain back compatibility, and go forward.

> Support old and new SHM until we can drop old.

How about no new SHM?  It is a mess from many angles.  The current SHM
does not come close to being POSIX compliant.  There is no way to fix
it the old way.

No need for a new solution.  A well tested solution already exists.

    https://xkcd.com/927/

The chrony socket protocol has been doing everything we need here, and
more. It is well established, debugged and documented.

It needs no locking

It supports 32-bit and 64-bit time_t

It already has a MAGIC value (sorta like a version.

It has much better access control.

It supports single writer multiple reader.

It avoids all the issues we know, and hate, about SHM.

Long past time for ntpd to support chrony sockets.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20230120/df3ac00e/attachment.bin>


More information about the devel mailing list