AlvaroBegue wrote:Imagine I close my laptop's lid for a couple of days, then open it up and launch a chess engine. I am happily playing against it and then an ntpd update happens, which makes it think it has been searching for some negative amount of time. I would say that's a bug in the engine because it is using the wrong clock.
Users with root access can mess up your clock_gettime readings if they want, and people can close the lid of their laptops. The former never happens and the latter happens all the time. But if you are incapable of admitting that you simply didn't think of people closing their laptops or disconnecting their computers from the Internet... well, that's between you and your therapist.
How would that happen? When you open it up, ntpd should start the update process instantly, and set the correct time BEFORE you get to run anything. If you mean that you start a search, close the lid, and then re-open it, and you REALLY expect it to work correctly, as the movie "grumpier old men pointed out." "you can wish in one hand, crap in the other, and see which one fills up first."
An ntp update should not happen AFTER you start the game. Most laptops (at least the decent ones running linux with ntp configured) would catch that resume/unsuspend event and get the date synced before you can run anything. I can't guarantee os X does this right since apple has their fair share of glitches and then some. But my linux laptops do this correctly. I suspend and resume all the time with nary a clock jump. In fact, since the hardware TOD clock is managed by the OS as well, the time should be pretty accurate within milliseconds of opening the lid, then ntpd will wake up and make any further corrections as needed, without large jumps back and forth.
Remember, not ALL of the operating systems around have that specific timing mechanism that is being discussed here. OSX is one example. I don't want to have to write timing code for N different operating systems, I want to just do one. One with ntpd has always worked flawlessly for anything we have done here, including the grandaddy of them all, trying to keep 128 compute nodes on a cluster synchronized to within 1ms for proper timestamping.
As far as opening/closing the lid however, I do it dozens of times per day, and I NEVER see time glitches. I would hardly expect a chess engine to work correctly, however, if I start a search, close the lid, and re-open it tomorrow. That is never going to work, nor should it.