Re: advice on how to detect time change
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Thu, 27 Sep 2007 15:41:56 -0000
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
.
- References:
- advice on how to detect time change
- From: d_cymbal@xxxxxxxxxxx
- Re: advice on how to detect time change
- From: John Hasler
- Re: advice on how to detect time change
- From: d_cymbal@xxxxxxxxxxx
- Re: advice on how to detect time change
- From: John Hasler
- Re: advice on how to detect time change
- From: d_cymbal@xxxxxxxxxxx
- advice on how to detect time change
- Prev by Date: Re: advice on how to detect time change
- Next by Date: Re: advice on how to detect time change
- Previous by thread: Re: advice on how to detect time change
- Next by thread: Re: advice on how to detect time change
- Index(es):
Relevant Pages
|