[ntp:questions] No libntp.so

Uwe Klein uwe at klein-habertwedt.de
Wed Aug 27 22:04:04 UTC 2008


Kay Hayen wrote:
> Hello Uwe,
> 
> thank you for your reply. :-)

> Yes that's right. I have this understanding that NTP was invented in the 
> field, wasn't it?
David Mills "invented" ntp in 1985 for authoritative time distribution
and syncing of machines. Notice "time" and "authoritative".

>>On the piping issue:
>>Thats what ptys are for. You would have ntpq as a running process that can
>>be queried at any time.
>>You run into nonlinebuffering issues on stdin and stdout due to both
>>not being ttys.
> 
> 
> Like I said, we know, pipes are not suited at all for the task. I must admit, 
> I was not aware of the issue before, I was under impression, we could simply 
> set stdin/stdout to no buffering, but it appears for pipes that is not an 
> option, and thinking about it, pipes really need to buffer.
MY guess is you don't know enough about unix(like) systems to build any
meaningfull software with the stringent requirements linked to your
applications environment.
You may want to read up on pipes, ptys and associated buffering.

> 
> We were considering to use an expect wrapper (python-expect) to channel the 
> data to us, and it would certainly improve the results. But I see no reason 
> to use that workaround at all. Why should we make ntpq draw ASCII art only to 
> parse it and endure the changes between your releases?
I personally don't release anything.

> 
> What we really want to do is to use libntp to send out some queries to the 
> ntpd servers we monitor (10 of them) and async wait for replies to process 
> them immediately and with minimal latency.
> 
> 
>>And you seem to work through your jobs in a serial way? Use select().
> 
> 
> Well, yes of course. Short of using expect, we ran ntpq each time anew and 
> fetched its response immediately. That was good enough for a prototype that 
> re-used parsing code that we already have for ntpq output, but now we would 
> like to do better.
well parsing any output with expect is trivial.
I wonder why Eurocontrol is well served with tcl.

G!
uwe

-- 
Uwe Klein [mailto:uklein at klein-messgeraete.de]
KLEIN MESSGERAETE Habertwedt 1
D-24376 Groedersby b. Kappeln, GERMANY
phone: +49 4642 920 123 FAX: +49 4642 920 125



More information about the questions mailing list