<div dir="ltr"><div dir="ltr">Gerald,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Aug 21, 2021 at 9:04 AM Gerald Klix via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Hilaire,<br>
<br>
I only did a short static analysis<br>
(a fancy word for looking at the code<br>
and scratching your head).<br>
<br>
IHMO there's a race condition:<br>
<br>
WorldMorph>>#runLocalStepMethods<br>
<br>
        | stepMessage |<br>
        [ stepList notEmpty and:<br>
            [ stepList first scheduledTime <= nowTime ]]<br>
                whileTrue: [<br>
                        stepMessage _ stepList first.<br>
<br>
<br>
This piece of code looks at the scheduleTime of the<br>
heap's first element then actually retrieves<br>
the first element.<br>
While this happens the heap in stepList may<br>
be changed by adding or removing elements.<br></blockquote><div><br></div><div>If that is the issue, I think there's a larger problem to be solved.  Morphic is inherently not thread safe so you're dealing with an intractable problem (short of re-architecting Morphic.)    Other than marking a morph for redraw, anything else touching Morphic from a background process needs to be wrapped in UISupervisor whenUIinSafeState: [].</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">
<br>
Please try the attached method and tell me if it helps.<br>
<br>
@Juan: Even if my change does not fix Hilaire's problem<br>
the method should still be changed.<br>
<br>
<br>
HTH,<br>
<br>
Gerald<br></blockquote><div><br></div><div>Thanks,</div><div>Phil </div></div></div>