<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 25 October 2013 02:35, John McIntosh <span dir="ltr">&lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 24, 2013 at 8:32 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</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"> <br><div dir="ltr"><br><div class="gmail_extra"><br><br>
<div class="gmail_quote">
On Thu, Oct 24, 2013 at 5:21 PM, tim Rowledge <span dir="ltr">&lt;<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>&gt;</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"><br>
<br>
On 24-10-2013, at 5:09 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; you mean stepping?<br>
&gt; you can signal that semaphore if someone needs to step, as easy as:<br>
&gt;<br>
&gt; [ [stepTime asDelay wait. sema signal ] repeat ] fork<br>
&gt;<br>
&gt; (sure not exactly like above, but you got an idea)<br>
&gt;<br>
&gt; i see no problem here.<br>
&gt;<br>
<br>
That - or something similar, as you say - would provide current morphic behaviour BUT it is really just a way to cause the problem time coalescing is trying to solve.<br>
<br>
I strongly suspect there is a lot of improvement in Morphic performance that can be gained by making the morphs do smarter (or less) stepping work. Obviously an animated widget is going to want to, well, animate. Almost all widgets to do with text display (editors, lists, buttons) aren&#39;t animating. They don&#39;t need to step unless there is good reason to think something relevant has changed. As an example, Scratch performance on a Pi took a good step (d&#39;oh, bad pun) forward simply by stopping UpdatingStringMorphs (used for watcher-morphs, for game scores etc) from querying and redisplaying their value every time and instead only re-displaying when the value changed. I suspect here are a lot of cases where we know that some code is going to change state that will then need displays updating and instead of relying on a large number of dumb polling tests we might use an analogue of the old changed/update mvc protocols that *only* advise of a need to step soon.<br>


</blockquote><div><br></div><div>OK, but these are separable issues.  Making morphs smart enough to know they&#39;re animated or not, and hence know whether they should be redrawn within 50ms or not is completely orthogonal from what the VM should do at idle.   When the VM has nothing to do it should sleep until there *is* something to do.  One of those things to do is to wake up when the mnext delay fires.  So *if* a Morph wants service 50ms from now the VM can still sleep until that time.</div>


<div><br></div><div>Can we please stop confusing the conversation and concentrate on the VM&#39;s bogus idle behaviour.  What we should eb concentrating on now is arranging that the VM can enter a fully quiescent idle state that it will exit when</div>


<div>- i/o is possible (which includes input events, there are a form of &quot;i&quot; in &quot;i/o&quot;</div><div>- a signal is delivered (except this could also be a variation of the above)</div><div>- the next delay is due to fire</div>


<div>- a callback has occurred</div><div>I think I&#39;m right in thinking that nothing else can happen that justifies the VM leaving its idle state.</div><div><br></div><div>Note that in the VisualWorks VM it is the scheduler that enters the idle state whenever there is no runnable process, and hence the idle process is conspicuously absent.  And a very nice solution that is too.</div>

</div></div></div></blockquote><div><br></div><div><br></div><div>Ok, that would be this code, what clock time is it now, what clock time  do we have to wake up at?  Sleep until then, or some interrupt.</div><div>
<br></div><div><span style="font-family:arial,sans-serif;font-size:13px">    now = ioMSecs();</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    next = getNextWakeupTick();</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">    realTimeToWait = next - now; </span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">    aioSleep((int) realTimeToWait*1000);</span><br>

</div><div><br></div><div> </div></div></div></div></blockquote><div>.. and along the lines i would also unify time units used by VM, <br></div><div>to get rid of unit conversions everywhere but in primitives/interacting with OS (which is platform-specific).<br>
<br>:)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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">
<div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote">
<div><br></div><div><br></div><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">
<div><br>
<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" target="_blank">http://www.rowledge.org/tim</a><br>
</div>Useful random insult:- A kangaroo loose in her top paddock.<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>===========================================================================<br>John M. McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" target="_blank">johnmci@smalltalkconsulting.com</a>&gt;<br>

Corporate Smalltalk Consulting Ltd. Twitter: squeaker68882<br>===========================================================================<br><br>
</div></div>
<br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Igor Stasenko.
</div></div>