<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 18, 2016 at 12:49 PM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><br><div><blockquote type="cite"><div>On 18.02.2016, at 12:33, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:</div><br><div><div dir="ltr" style="font-family:FiraSans-Regular;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Hi Marcel,<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 18, 2016 at 12:07 AM, marcel.taeumel<span> </span><span dir="ltr">&lt;<a href="mailto:Marcel.Taeumel@hpi.de" target="_blank">Marcel.Taeumel@hpi.de</a>&gt;</span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi, there!<br><br>The VM seems to &quot;cache&quot; the wall clock. This is weird.<br><br>Here is the story: I just booted into Windows and my time was wrong. Seems<br>to be come Surface bug. It still was at the sleep time yesterday evenening,<br>11pm.<br><br>Squeak was already open, reporting the same.<br><br>Then, I updated the system time by letting Windows sync with Microsofts time<br>server.<br><br>And then, the still running Squeak VM reported still the old values!!! :-/<br>How can that happen?<br></blockquote><div><br></div><div>By my having coded time management in the Windows VM wrong?  Look at sqWin32Heartbeat.c.</div><div>This all needs rewriting anyway given the discussion on monotonic vs wall time.   I&#39;d like to have one copy of the code that computes the VM&#39;s notion of time, perhaps written in Smalltalk, and place that above platform-specific code that answers the monotonic and wall clocks.</div><div><br></div><div>But what should the VM do if it is faced with a huge jump in the time?  Let&#39;s say that for testing you set the clock on your machine to 1970, then you started Smalltalk, and then you enabled syncing with the time server and the clock jumped forward to 2016.  One could have the VM try to compensate but I think the best thing is to say &quot;don&#39;t do that&quot; and require teh user to restart their image.  It&#39;s reasonable for the VM to maintain a clock that undergoes ntpd-like adjustments.  It&#39;s complicated to have the VM try and distinguish small ntpd-like adjustments form huge adjustments in the clock.  And keeping it simple seems like the best solution.</div></div></div></div></div></blockquote><br></div></span><div>Why can’t we simply decouple the low-precision wall-clock from the high-precision monotonic clock used for timing? Marcel’s use case isn’t that unusual. I put my machine to sleep with images open all the time. That should work without having to restart the image.</div></div></blockquote><div><br></div><div>I think we must be talking about two different things.  The utc coming into the VM either changes by small ammounts (via ntp) or by huge ammounts (programmer intervention).  The VM can easily maintain a clock that copes with small changes to the value of utc by allowing its time, derived from the machine&#39;s monotonic time, to drift towards utc at no more than a given percentage of monotonic time.  If this algorithm is used (it has the nice properties that we only need one clock for all services and that clock is acceptably accurate for measuring durations) it can&#39;t ever catch up with huge differences in teh value of utc, as would be caused by e.g. setting the system clock to 1970/1/1, starting Smalltalk and setting the time to 2016/2/18.</div><div><br></div><div>But that&#39;s a completely different notion to saving the image and restarting it aeons later. utc will have changed bu a huge ammount but the VM will start from the value of utc when it starts up, and has nothing to do with the time when the image was saved.</div><div><br></div><div>So I don&#39;t undersand hat you&#39;re getting at.</div><div><br></div><div>But for me I very much want to have *one clock* in tghe VM.  That&#39;s an advantage of using a utc microsecond clock.  All other clocks of lesser resolution can be derived from it.  If you look at the situation before with a separate second clock and millisecond clock you saw absurdities like the image spin looping for up to a second (half a second on average) just to find out what the value of the millisecond clock is when the second clock ticks.  Tis is absurd both because a) it wastes up to half a second on startup, a disaster in e.g. a container farm scenario and b) because it assumes that the second clock and millisecond clock are synchronised, which they aren&#39;t, so in a day or so the two will have drifted so much that timestamps will be inaccurate.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div><br></div><div>- Bert -<br><br><br>

</div>
<br></font></span></div><br><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>