<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi Christoph.<div><br></div><div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">>> <span style="font-size: 12pt">It's true that in Morphic there </span><span style="font-size: 12pt">is one distinct Process associated</span></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><span style="font-size: 12pt">>> with the user interface for each Morphic </span><span style="font-size: 12pt">world.</span></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><span style="font-size: 12pt">> I'm not so sure about this. You can always do</span><span style="font-size: 12pt"> forks within UI code, </span></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><span style="font-size: 12pt">> so sometimes there are also multiple Processes within one Morphic </span></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><span style="font-size: 12pt">> world. Just think about Shout's background process or debugging</span></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><span style="font-size: 12pt">> processes, and please keep in mind that Jakob justifiably proposed to</span></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><span style="font-size: 12pt">> renew the process handling for non-modal dialogs, which maybe could</span></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><span style="font-size: 12pt">> also result in multiple processes being active at the same time.</span><br></div></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">There is (and should) only be a single UI process running in Morphic at any time. All other processes that can be scheduled must synchronize with that single UI process when doing UI stuff. Shout, for example, does that via #addDeferredUIMessage:, which is effectively a SharedQueue (using a Mutex or similar). Having two UI processes running (or be scheduled) at the same time will produce strange side effects or even lock up the image. I don't know. At least, things will slow down.</div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">You could change that by re-desiging the ownership partitioning of UI objects. Even then, there will be some process responsible for a set of UI objects. All other processes must synchronize into that one when talking to those (foreign) UI objects.</div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">I forgot. When does process switching happen through higher-priority processes having a semaphore ready (i.e. Delay >> #wait)? At byte-code level? Oder message-send level? Well, you might not see the effects of omitting such process synchronization immediately. However, occasionally, debuggers with "nil does not understand" may pop up. Causing you headaches. :-)</div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px"><br></div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">Best,</div><div class="x__rp_T4" id="x_Item.MessagePartBody" style="font-family: Calibri, Arial, Helvetica, sans-serif;font-size: 16px">Marcel</div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 24.09.2020 14:08:56 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<p><span style="font-size: 12pt">Hi all,</span></p>
<p><span style="font-size: 12pt"><br>
</span></p>
<p><span style="font-size: 12pt">sorry for the long delay on this issue. I'm attaching a new version of the changeset including the following changes:</span></p>
<p><span style="font-size: 12pt"><br>
</span></p>
<p><span style="font-size: 12pt"></span><span style="font-size: 12pt">*</span><span style="font-size: 12pt"> Use DynamicVariables for storing the active variable states</span></p>
<p><span style="font-size: 12pt"></span><span style="font-size: 12pt">*</span><span style="font-size: 12pt"> Refactor and reduce the visibility of active variable accessors on Object</span></p>
<p><span style="font-size: 12pt"></span><span style="font-size: 12pt">*</span><span style="font-size: 12pt"> Clean up implementations of #activeHand and #primaryHand</span></p>
<p><span style="font-size: 12pt"><br>
</span></p>
<p><span style="font-size: 12pt">@Dave I think associating these objects to Process is an implementation detail of DynamicVariables which I would not like to denigrate in general.</span><br>
</p>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols">
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0,0,0);font-family: Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><span style="font-family: Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size: 12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</span></div>
</div>
</div>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">> <span style="font-size: 12pt">It's true that in Morphic there </span><span style="font-size: 12pt">is one distinct Process associated with the user interface for each Morphic </span><span style="font-size: 12pt">world.</span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt"><br>
</span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt">I'm not so sure about this. You can always do</span><span style="font-size: 12pt"> forks within UI code, so sometimes there are also multiple Processes within one Morphic world.
 Just think about Shout's background process or debugging processes, and please keep in mind that Jakob justifiably proposed to renew the process handling for non-modal dialogs, which maybe could also result in multiple processes being active at the same time.</span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt">A world can have multiple hands, for example, RemoteHandMorphs (Nebraska), event-simulating hands (EventRecorder), or just multiple plain HandMorphs as demonstrated by Tony recently in
 his <span>PostmarketOS implementation. There is no reason for these hands to run on the same process. Analogously, I don't see why we should restrict a hand not to be thread-safe, so the hand-event relation is 1:n again.</span></span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt"><span><br>
</span></span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt"><span>PS: Thanks for the hint to the new wiki page!</span></span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt"><span><br>
</span></span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt"><span>Best,</span></span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt"><span>Christoph</span></span></div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><span style="font-size: 12pt"><br>
</span></div>
</div>
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von David T. Lewis <lewis@mail.msen.com><br>
<b>Gesendet:</b> Montag, 14. September 2020 17:49:34<br>
<b>An:</b> The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] Changeset: Eliminating global state from Morphic</span>
<div> </div>
</div>
</div>
<span style="font-size: 10pt"><span style="font-size: 10pt">
<div class="PlainText">On Mon, Sep 14, 2020 at 11:17:53AM +0000, Thiede, Christoph wrote:<br>
> Hi Dave,<br>
> <br>
> <br>
> I agree that could try to place the active variables at better places than the most generic Object class. Still, I am not sure whether you are arguing against the thread-local storage of their values - which I do find pretty important for enabling concurrency.<br>
> <br>
> <br>
> Of course, we could move my proposed implementation #activeWorld down to Project, and on Object, forward the request to "Project current activeWorld". Still, I do not think that an instance variable would be the right way to store the world, because it is
 not thread-local. If you would like to do this, we should implement some kind of PluggableThreadLocalVariable as proposed below, and store an instance of this class in Project.<br>
> <br>
> <br>
> What do you think?<br>
> <br>
<br>
Hi Christoph,<br>
<br>
The thing that I like (a lot) about your changes is that they make it<br>
much easier to see and understand the accesses to the global variables.<br>
The references now all go through a small number of methods in Object,<br>
so that you can see what they do now.<br>
<br>
Clearly we would want to leave this logic in Object, since we don't<br>
want to add more clutter to its protocol. But you have collected the logic<br>
in one place now, which makes it easier to think about where it ultimately<br>
should go, and that's great.<br>
<br>
But where do these things actually belong?  Thinking in terms of the<br>
responsiblities of objects in the system [1], I don't think that associating<br>
them with a Process seems to be a good fit. It's true that in Morphic there<br>
is one distinct Process associated with the user interface for each Morphic<br>
world. So you can make things work by associating these variables with<br>
a Process, but it seems like an unnatural fit to me. A Morphic world has<br>
a process, but a Process is not responsible for knowing the state of<br>
the Morphic world.<br>
<br>
Dave<br>
<br>
[1] <a href="https://en.wikipedia.org/wiki/Responsibility-driven_design#:~:text=Responsibility%2Ddriven%20design%20is%20a,information%20that%20the%20object%20shares">
https://en.wikipedia.org/wiki/Responsibility-driven_design#:~:text=Responsibility%2Ddriven%20design%20is%20a,information%20that%20the%20object%20shares</a>.<br>
<br>
<br>
</div>
</span></span></div>
</div></blockquote></div>