Alain said:
Is there any good reason why some of the industrial machines we use run spot
on time (08:00 is correct every morning) and other lose as much as 2hrs in a
day? Machines are a combination of XP SP2 and SP3 and a mixture of Pentium 4
2.8Ghz single core and Intel i3 dual core 2.4Ghz, but are basically
configured almost indentically. Some systems with exactly the same hardware
and OS behave differently, losing differtent amounts of time over a day.
Thanks,
Alain
A good reason for a computer to be synced exactly, is it is accessing
an NTP server on the net, and correcting the time on a regular
basis. That computer, will then seem heroic. I have NTP enabled on
this machine, and the current time error is 3 seconds since last
sync (yesterday). NTP not only allows a single point correction
to the time, but it is also possible to compute a "drift rate", and
make corrections more continuously (I don't know whether the
Windows version does that or not).
When the computer is off, the time keeping is handled by the RTC
and the cylindrical 32768 Hz quartz crystal on the motherboard.
That is the same crystal, used in a digital watch.
When the computer is running, the OS reads the RTC, and copies the
time into software. From that point onward, time keeping is maintained
by counting clock tick interrupts. The drift of clock tick interrupts
is traceable to a different quartz crystal on the motherboard in
that case, than the RTC one.
If something interferes with the ability to service clock tick interrupts,
a one-sided error in time keeping will result (slowdown). The clock tick
interrupt has a relatively high priority, but there are other hardware
mechanisms available on a PC, that can "steal" time. Intel invented
the SMM feature, which is virtually undetectable when the computer
is running. That's just one example of something that affects the
computer, but you can't do anything about it.
http://en.wikipedia.org/wiki/System_Management_Mode
"This can destroy real-time behavior and cause clock ticks to get lost."
The Nforce2 based motherboards had some problems with time keeping,
but in that case, it seemed to be a bug involving the APIC.
It was some kind of interrupt issue. The bug showed up, when the
chipset was set to a non-canonical clock rate (typically, something
an overclocker might do). The drift was so large, and was also
+ and - the correct time value, that even with NTP enabled and
the update rate cranked to the wall, it still couldn't make
a good time piece from the computer. Huge errors could result.
So it is possible for a hardware bug, to trash the time keeping
of a computer.
Modern computers have a large number of timers and time keeping
options. You're likely to find a good overview of that topic,
on one of the virtual machine web sites, as virtual machine
design has to emulate some of those features, and deal with the
errors that result from less than perfect emulations. I don't think
I could do a good enough job of describing them all.
Paul