ntpd: program structure

Hal Murray hmurray at megapathdsl.net
Sat Jan 5 09:25:57 UTC 2019


The current code is a combined client and server.  I think we should split 
that into separate programs.  Maybe not right away, but we should at least 
start thinking that way.

The server side is simple.  It gets time from the system.  There are a few 
other parameters that either need to come from the system (via ntp_adjtime?) 
or from the server via shared memory or similar.

We should be able to run multi-threaded with only minimal changes.  It would 
need locks for updating various statistical counters.  There are probably 
others, but I can't think of them.

We would probably want to restructure things a bit.  For example, a thread (or 
several) would be associated with a socket rather than going through a layer.

The client is pretty much what we have.  Just ignore the small amount of 
server code.  If we run it on another port, we can run it at the same time as 
a server.

I'm not sure what to do with ntpq.  Most of what I use it for (peers, -p) is 
talking to the client but the server would be listening on port 123.

Anyway, I think that thinking about them as separate parts will help our 
discussions.
We should be able to improve performance on busy servers.


-- 
These are my opinions.  I hate spam.





More information about the devel mailing list