
16 May
2006
16 May
'06
11:13 p.m.
Roland Schwarz wrote:
What do you think are xtime's pitfalls in this [condition::timed_wait] respect?
The problem is that xtime uses UTC time. The current system UTC time can jump forward or backward as the system clock is adjusted manually or automatically via NTP. So if the clock jumps backward two minutes at exactly the wrong moment, a timed_wait that was supposed to wait one second will now wait two minutes and one second. On the other hand, if one is writing an event scheduler of some sort, it would be natural to use UTC time even when monotonic time is available and the above behavior might actually be desirable.