[reactive] Clock skew corrections

Robin Green greenrd at greenrd.org
Tue Aug 25 06:05:30 EDT 2009


What happens if the system clock is running too fast, this is noticed,
and the system clock is corrected, during a program run? I think this
could break temporal monotonicity of occurrences in events, as
FRP.Reactive.Internal.Clock doesn't know about system clock corrections.
Am I right? If so, what, if anything, should be done about it?

One rather inefficient approach would be to have a global mutable
variable and a mutex for that variable, to record the last known time
"reading" for the entire system, and a temporal adjustment factor
(initially zero). If the difference between the last reading and the
(adjusted) current reading was a positive number, that difference would
be added to the temporal adjustment factor. This would prevent temporal
monotonicity being broken.
-- 
Robin


More information about the Reactive mailing list