[ntp:questions] .1 Microsecond Synchronization

Rick Jones rick.jones2 at hp.com
Thu Jun 4 21:23:47 UTC 2009

ScottyG <scottg at pepex.net> wrote:
> To do this the order in which market data was received and trades
> transmitted need to be maintained. I do know from their current log
> files that 1 ms is not fine enough for this and that on occasion .1
> ms is not good enough. They currently are using a feature of the
> processors that seems to return clock tick on the microprocessor
> (Some assembly language instruction). 

Most if not all modern CPUs have an "interval counter" or a similar
rose by another name that counts at some fixed rate that may or may
not be a fixed frequency to the clock rate of the processor.  In
PA-RISC it is called "CR16" or "Control Register number 16" and is
accessed via a "move from control register" instruction often executed
as some inline assembly in otherwise regular "C" code.  Itanium calls
it the ITC (iirc) and it is accessed in a similar fashion.  Other
processors will be a variation on the theme.

> They have an algorithm for controlling the skew that occurs using
> this method. This seems to meet there needs in a single server
> scenario but when going across machines this will obviously not
> work.

Depending on the HW and OS/application support it may not even work on
a single machine with multiple processors when/if there is migration
from one core to another.  HP-UX on PA-RISC and Itanium will "sync-up"
(although perhaps not to the rigorous standards of the NTP gurus :)
the interval counters on the disparate processors, and I think Linux
does the same.  Which other OS/HW combinations do so I'm not sure.

rick jones
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...

More information about the questions mailing list