Re: advice on how to detect time change



On 2007-09-27, d_cymbal@xxxxxxxxxxx <d_cymbal@xxxxxxxxxxx> wrote:

The master device can run NTP and keep its clock in sync. The
master can notify the slaves of a time change through a
proprietary mechanism. The slaves cannot run NTP themselves.
So, I need a mechanism for the master device to detect that
something, be it the NTP client, the user, or whatever, has
changed its local system time

You're going to have to define "changed the system time" if you
want a useful answer.

so that it can proxy this event through to the slaves. I was
trying to avoid having the slaves constantly poll the master

I don't see how you can avoid it. If you want to detect a
difference between the master's time and the slave's time,
you're going to need both values to compare them. Somebody's
got to poll somebody.

for changes as the desire would be for a time change on the
master to trickle through the system in fairly short order
(does not need to be real time)

You seem to be worried only about large step-changes in the
master's time. There are two issues with that:

1) NTP (or any properly designed clock correction algorithm)
will not make step changes. People work very hard to make
sure that the adjustments made by NTP and the like are not
detectable.

2) Even if NTP did make step changes, how are you going to
detect whether the slaves are gradually drifting out of
sync without polling them?

and I did not want the slaves polling constantly with short
frequencies (or conversely have the master sending frequent
updates). My hope was to be able to detect the change on the
master and then push the update to the slaves through the
proprietary channel.

If all you want to do is detect large step changes, then
running a program that compares changes in time-of-day (e.g.
gettimeofday()) with changes in elapsed time (e.g. clock())
should be work.

--
Grant Edwards grante Yow! Sign my PETITION.
at
visi.com
.



Relevant Pages

  • Re: advice on how to detect time change
    ... Putting an NTP ... time out from under it (this is a master device which must globally ... such as ntp) changes the time on the master system. ... slave and configure the slaves to track the master. ...
    (comp.os.linux.development.apps)
  • Re: "ntpd -q" is slow compared to ntpdate
    ... on why 'ntpd -q -g' is slow. ... progress if the external NTP server was down. ... So the slaves need to quickly ... update the clock to roughly the same time as the master, ...
    (comp.protocols.time.ntp)
  • Re: [RFC/PATCH 0/22] W1: sysfs, lifetime and other fixes
    ... defined in family driver. ... Bus master driver - is like NIC driver, it does not know about the rest ... It has it's logical slaves, it has it's own attributes and features, ... This is wrong - netlink notification is used and will be moved to ...
    (Linux-Kernel)
  • Re: tcl and threads: installing and other info
    ... So I'd like to parallelise the notification processing. ... a event based master process using ... more stable in case one of the slaves crashes or does nasty things. ... If you don't have enough memory for the database to do its ...
    (comp.lang.tcl)
  • Re: [RFC/PATCH 0/22] W1: sysfs, lifetime and other fixes
    ... > Why do you need separate files? ... >> link between private data and master and set useable master's name. ... but slave count and slaves attributes itself requires that mutex. ... >> structure and have family drivers create necessary attributes ...
    (Linux-Kernel)