<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 30, 2017 at 3:47 PM, Clément Bera <span dir="ltr"><<a href="mailto:bera.clement@gmail.com" target="_blank">bera.clement@gmail.com</a>></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><div class="gmail_quote">On Sun, Oct 29, 2017 at 5:35 PM, Ben Coman <span dir="ltr"><<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 29, 2017 at 10:49 PM, Clément Bera <span dir="ltr"><<a href="mailto:bera.clement@gmail.com" target="_blank">bera.clement@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 28, 2017 at 5:55 PM, Ben Coman <span dir="ltr"><<a href="mailto:btc@openinworld.com" target="_blank">btc@openinworld.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><div>hi Clement,</div><div><br></div><div>I was watching your nice talk on Pharo Optimizing JIT Internals. At 14:40 [1]<br></div><div>you mention VM call-back to Scorch DNU-style.  I was just curious how that might affect the jitter of the DelayScheduler waiting for the timingSemaphore set by "primSignal: timingSemaphore atMilliseconds: millisecondNextTick" </div><div>to be signalled by the VM?</div></div></blockquote><div><br></div><div>I am not sure I understand the question. Only 1 optimisation call-back is running at once (It disables itself when started, re-enables itself at the end). If another green thread takes over the runtime, the optimisation of the function will time out. The other green thread can then be optimized. Does this answer the question ?</div></div></div></div></blockquote><div><br></div><div>Partly answered.  So my current perception is that execution only stays in the VM for very short periods, so the VM code generating the timingSemaphore ticks occurs frequently and the Image code can be responsive to the clock ticks.</div><div><br></div><div>If the VM does a callback into the Image when a hotspot is detected, I presume the VM is blocked at that point waiting for the callback to return(??), which may delay the VM signalling timingSemaphore and the Image receiving it.   </div><div><br></div><div>I don't quite follow the part about another green thread taking over?  Would the VM callback to Scorch operate at a particular priority level? (what priority?)</div><div>So the timing event loop at priority 80 would get a chance to preempt the scorch callback?  But even then, the VM wouldn't have generated the signal if its paused at the callback point.  </div></div></div></div></blockquote><div><br></div><div>Scorch VM call-back is at the priority of the green thread starting it. It has a limited time window to perform optimisation. During that time window Scorch is disabled on all green threads to avoid infinite loops with Scorch optimising itself. If the green thread is preempted, likely the time window will time out and another green thread will be able to perform optimisation. The time window is currently guaranteed using BlockClosure>>#valueWithin:<wbr>onTimeout:.</div></div></div></div></blockquote><div><br></div><div>That explains it clearly, thanks.  </div><div>cheers -ben</div><div><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"><div><br></div><div>You can read the Metacircular chapter of my thesis [1] which deals with this kind of problems. The specific case you mention is not detailed though.</div><div><br></div><div>Still not sure this answers the question since I am not very familiar with the VM signalling timingSemaphore.</div><div><br></div><div>[1] See ReadMe in <a href="https://github.com/clementbera/PHDThesis" target="_blank">https://github.com/<wbr>clementbera/PHDThesis</a></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Sorry I feel like I'm missing something making it hard to frame a good question.</div><div><br></div><div>cheers -ben </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>[1] <a href="https://youtu.be/yDKaHphbFow?list=PLJ5nSnWzQXi_THfKwhzxFwbXy00YTi0uv&t=883" target="_blank">https://youtu.be/yDKaHphbFow?l<wbr>ist=PLJ5nSnWzQXi_THfKwhzxFwbXy<wbr>00YTi0uv&t=883</a></div><div><br></div><div>cheers -ben</div><div><br></div><div><br></div><div>P.S. Later when you say Sista will be an optional VM - curious whether Sista might be switched on/off from within the VM? or just a command line flag? or an actual different VM (which adds complexity to system management).<br></div><div><br></div></div></blockquote><div>Different VMs. In the Sista VM you can turn things on/off. In the default VM you only have unoptimized behavior. Once the image has Sista methods it requires the Sista VM unless you switch it off and revert all optimised code.</div></div><br><br clear="all"><div><br></div>-- <br><div class="m_-4614200891056092931gmail-m_1662452147099041223m_-8660744369033505557gmail_signature"><div dir="ltr"><span style="font-size:12.8px">Clément Béra</span><div style="font-size:12.8px">Pharo consortium engineer</div><div style="font-size:12.8px"><a href="https://clementbera.wordpress.com/" target="_blank">https://clementbera.wordpress.<wbr>com/</a><br></div><div style="font-size:12.8px"><span style="line-height:16px">Bâtiment B 40, avenue Halley 59650 </span><span style="font-weight:bold;line-height:16px">Villeneuve d'Ascq</span></div></div></div>
</div></div>
<br></blockquote></div><br></div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-4614200891056092931gmail_signature"><div dir="ltr"><span style="font-size:12.8px">Clément Béra</span><div style="font-size:12.8px">Pharo consortium engineer</div><div style="font-size:12.8px"><a href="https://clementbera.wordpress.com/" target="_blank">https://clementbera.wordpress.<wbr>com/</a><br></div><div style="font-size:12.8px"><span style="line-height:16px">Bâtiment B 40, avenue Halley 59650 </span><span style="font-weight:bold;line-height:16px">Villeneuve d'Ascq</span></div></div></div>
</div></div>
<br></blockquote></div><br></div></div>