[ntp:questions] Re: ntp client over satellite and no CMOS battery

Martin Burnicki martin.burnicki at meinberg.de
Tue Sep 13 08:46:37 UTC 2005


Danny,

Danny Mayer wrote:
[...]
>> At the first glance a possible workaround seems to be that NTP would
>> already set the mm timer to high?est resolution at startup.
>> 
> How would it do that?

Using the API calls provided by Windows, which are presumably also used by
those mm apps:
  timeGetDevCaps()
  timeBeginPeriod()
  timeEndPeriod()
 
I'll send you some code which can be called at startup.

>> However, you know that under Windows, NTP uses a timer callback function
>> which is used to interpolate the system time between two timer ticks.
>> Normally this callback function is called by the kernel at regular
>> intervals, but as soon as the multimedia timers have been modified, the
>> system time reported to that callback function jitters by 1 millisecond,
>> so interpolation doesn't work as reliably as it does normally.
>> 
> Which timer callback function are we discussing here?

The clock thread which interpolates the Windows timer ticks. 
It's started by StartClockThread() in nt_clockstuff.c.
 
>> The exact effects also vary depending on whether the system is normal
>> uniprocessor, or multiprocessor (including CPUs with hyperthreading),
>> presumably due to the version of the Windows HAL which is installed.
>> 
>> So performance of time synchronization would be degraded if NTP would set
>> the mm timer on a systems where normally no mm apps would run.
>> 
> How do you know that?

I've tested it with one of our GPS cards. The program reads times stamps
from the GPS card with microsecond resolution and accuracy, and also the
Windows system time, and displays the difference between both.

So I can observe that the difference steps in one direction if a mm app is
started and steps back in the contrary direction if that mm app stops.

As already mentioned in my earlier posts also on the machine (see the quote
above), and it doesn't seem to happen anymore under Windows XP SP2.

I'll investigate more on this.

>> Maybe a command line switch could be introduced which would control
>> whether NTP should modify the mm timer, or not.
>> 
> I'm not sure how you would modify the mm timer.

Please have a look at the code I'll send you.


Martin
-- 
Martin Burnicki

Meinberg Funkuhren
Bad Pyrmont
Germany




More information about the questions mailing list