<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>That has to be one of the oldest bugs! It's been there forever. I just committed that to trunk.</div><div><br></div><div>There is still a problem though. Squeak's delays (with Bob's fix) are based on image "running time". That is, if I have a 1 hour delay and snapshot the image after 45 minutes, on the next day it will expire 15 minutes after starting the image.</div><div><br></div><div>But arguably a delay should really expire by the same wall-clock time as when it was scheduled, even across snapshots. This is how it was handled in Smalltalk-80. Here's the ST80 code:</div><div><br></div><div><div><div>Delay>>preSnapshot</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"convert from local millisecond clock to milliseconds since Jan. 1 1901"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>pendingDelay _ resumptionTime - Time millisecondClockValue.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>resumptionTime _ Time totalSeconds * 1000 + pendingDelay</div><div><br></div><div>Delay>>postSnapshot</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>"convert from milliseconds since Jan. 1 1901 to local millisecond clock"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>pendingDelay _ resumptionTime - (Time totalSeconds * 1000).</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>pendingDelay _ pendingDelay max: 0.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>resumptionTime _ Time millisecondClockValue + pendingDelay</div></div></div><div><br></div><div>Of course, we would have to use UTC nowadays but I still think re-implementing this would be a good idea.</div><div><br></div><div>In any case, the fix makes the Delay snapshotting behavior at least predictable :)</div><div><br></div><span style="font-family: Helvetica; font-size: 12px; ">- Bert -</span><div><font face="Helvetica"><br></font><div><div>On 2013-08-06, at 21:57, Bob Arning <<a href="mailto:arning315@comcast.net">arning315@comcast.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
<font face="Georgia">Well, this seems to fix it:<br>
<br>
'From Squeak4.4 of 1 March 2013 [latest update: #12489] on 6
August 2013 at 3:39:29 pm'!<br>
<br>
!Delay class methodsFor: 'snapshotting' stamp: 'raa 8/6/2013
15:22'!<br>
restoreResumptionTimes<br>
"Private!! Restore the resumption times of all scheduled
Delays after a snapshot or clock roll-over. This method should be
called only while the AccessProtect semaphore is held."<br>
<br>
| newBaseTime |<br>
newBaseTime := Time millisecondClockValue.<br>
SuspendedDelays do: [:d | d adjustResumptionTimeOldBase: 0
newBase: newBaseTime].<br>
ActiveDelay == nil ifFalse: [<br>
ActiveDelay adjustResumptionTimeOldBase: 0 newBase:
newBaseTime.<br>
].<br>
ActiveDelayStartTime _ newBaseTime "<-----this"! !<br>
<br>
Cheers,<br>
Bob<br>
<br>
</font>
<div class="moz-cite-prefix">On 8/6/13 3:27 PM, tim Rowledge wrote:<br>
</div>
<blockquote cite="mid:9C4C3A4B-9B0A-41FA-9122-AF684FC2FBC4@rowledge.org" type="cite">
<pre wrap="">Well the timer stuff has certainly been messed about with a lot since I last had to dig into it, but it looks like it *ought* to work ok.
The only likely culprit I can spot is some issue with adjusting the resumption times after the restart, but that would require some problem with the millisecond time prim.
tim
--
tim Rowledge; <a class="moz-txt-link-abbreviated" href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a class="moz-txt-link-freetext" href="http://www.rowledge.org/tim">http://www.rowledge.org/tim</a>
Strange OpCodes: YVR: Branch to Vancouver
</pre>
</blockquote>
<br>
</div>
<br></blockquote></div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; font-size: 12px; "><br class="Apple-interchange-newline"></span>
</div>
<br></div></body></html>