<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>Yes, making Delays work accurately wrt wall-clock time would be more work now that I think about it. This seems to be better handled in a higher-level object.</div><div><br></div><div><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; font-size: 12px; "><div style="font-family: Helvetica; ">- Bert -</div><br class="Apple-interchange-newline"></span></div><div><div>On 2013-08-07, at 16:16, Bob Arning &lt;<a href="mailto:arning315@comcast.net">arning315@comcast.net</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
  
  <div text="#000000" bgcolor="#FFFFFF">
    <font face="Georgia">I was thinking about that, but I suspect there
      are use cases for both image time and real-world time. Maybe
      something like<br>
      <br>
      (Delay until: someRealTime) wait<br>
      <br>
      would meet the need the current Delay does not.<br>
      <br>
      Cheers,<br>
      Bob<br>
      <br>
    </font>
    <div class="moz-cite-prefix">On 8/7/13 9:54 AM, Bert Freudenberg
      wrote:<br>
    </div>
    <blockquote cite="mid:45E5467C-0B0A-426D-9CD8-5CBC34E65545@freudenbergs.de" type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <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&nbsp;delay should really expire by the same
        wall-clock time as when it was scheduled, even across
        snapshots.&nbsp;This is how it was handled in Smalltalk-80. Here's
        the ST80 code:</div>
      <div><br>
      </div>
      <div>
        <div>
          <div>Delay&gt;&gt;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&gt;&gt;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 &lt;<a moz-do-not-send="true" href="mailto:arning315@comcast.net">arning315@comcast.net</a>&gt;
            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>
                &nbsp;&nbsp;&nbsp; "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>
                &nbsp;&nbsp;&nbsp; | newBaseTime |<br>
                &nbsp;&nbsp;&nbsp; newBaseTime := Time millisecondClockValue.<br>
                &nbsp;&nbsp;&nbsp; SuspendedDelays do: [:d | d
                adjustResumptionTimeOldBase: 0 newBase: newBaseTime].<br>
                &nbsp;&nbsp;&nbsp; ActiveDelay == nil ifFalse: [<br>
                &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ActiveDelay adjustResumptionTimeOldBase: 0
                newBase: newBaseTime.<br>
                &nbsp;&nbsp;&nbsp; ].<br>
                &nbsp;&nbsp;&nbsp; ActiveDelayStartTime _ newBaseTime "&lt;-----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 moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:tim@rowledge.org">tim@rowledge.org</a>; <a moz-do-not-send="true" 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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap=""></pre>
    </blockquote>
    <br>
  </div>

<br></blockquote></div><br></body></html>