<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Calibri Light";
panose-1:2 15 3 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.MsoNoSpacing, li.MsoNoSpacing, div.MsoNoSpacing
{mso-style-priority:1;
margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
color:black;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Sorry, here’s the snip…</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:cuis-dev@lists.cuis.st">Jaromir Matas via Cuis-dev</a><br>
<b>Sent: </b>Friday, July 15, 2022 20:24<br>
<b>To: </b><a href="mailto:JuanVuletich@zoho.com">Juan Vuletich</a>; <a href="mailto:cuis-dev@lists.cuis.st">
Discussion of Cuis Smalltalk</a><br>
<b>Cc: </b><a href="mailto:mail@jaromir.net">Jaromir Matas</a><br>
<b>Subject: </b>Re: [Cuis-dev] FW: FW: FW: Freezing UI - can't interrupt via Alt+.</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi Juan,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Many thanks for sharing your opinion. I agree a UI busy with a long computation is a bit different situation (and complexity level most likely) than an idle UI being blocked. I'm thrilled you've made it possible for a system to keep interacting
even if its UI is blocked on a semaphore (or a condition variable in a general case). I think this is a very nice improvement from a user perspective; I remember it baffled me some computations worked differently when run forked compared to "straight" (without
fork). Then someone explained "yeah, that's because it is run in the UI" and it really didn't help me understand why the difference :) Now I know, of course, but for a beginner (or at least for me) the concept of running a Workspace example "in the UI" is
far from trivial.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--<o:p></o:p></p>
<p class="MsoNormal">> The base image doesn't even include networking code. It will only access local files.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you :)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--<o:p></o:p></p>
<p class="MsoNormal">> Letting the old Morphic process end by itself may mean that there is more than one process trying to draw the world. And if some higher priority process wakes up, maybe the other morphic process is scheduled next. Just pushed a couple
of tweaks to reduce the risk as much as possible.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">That helped indeed :) A little new glitch appeared though: <o:p>
</o:p></p>
<p class="MsoNormal">When you do<o:p></o:p></p>
<p class="MsoNormal">self halt<o:p></o:p></p>
<p class="MsoNormal">the world redraw's incomplete or something - see attached snip. Clicking World Menu -> Restore Display fixes it.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--<o:p></o:p></p>
<p class="MsoNormal">A small suggestion: the old UI process still identifies as 'Morhic UI' in the Process Browser; would it make sense to rename the old UI to e.g. 'Inactive Morphic UI' ?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">--<o:p></o:p></p>
<p class="MsoNormal">Then there's something I believe has nothing to do with the latest UI modifications but I only noticed it recently by accident:<o:p></o:p></p>
<p class="MsoNormal">If you open an image and then open the same image again (to be precise: in my case I doubleclick on squeak.exe, the image opens, then I doubleclick squeak.exe again) then the second OS process starts running in the background taking 100%
of one CPU's core capacity (and nothing opens) and it needs to be killed from the OS (Windows process explorer etc)<o:p></o:p></p>
<p class="MsoNormal">It happens in my image Cuis6.0.5171 with the latest VM 3184 but doesn't in Cuis6.0.5069 with VM 3184 (I've just checked - it's regardless of the VM)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Juan, thanks so much for this experience! I look forward to studying your code :)<o:p></o:p></p>
<p class="MsoNormal">best,<o:p></o:p></p>
<p class="MsoNormal">Jaromir<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNoSpacing"><span lang="CS">--</span></p>
<p class="MsoNoSpacing"><strong><span style="font-family:"Calibri Light",sans-serif;color:#333333;font-weight:normal">Jaromír Matas</span></strong><span style="font-family:"Calibri Light",sans-serif;color:#555555"><o:p></o:p></span></p>
<p class="MsoNoSpacing"><span style="font-family:"Calibri Light",sans-serif;color:#2E75B6">mail@jaromir.net</span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From: </b><a href="mailto:JuanVuletich@zoho.com">Juan Vuletich</a><br>
<b>Sent: </b>Friday, July 15, 2022 1:26<br>
<b>To: </b><a href="mailto:cuis-dev@lists.cuis.st">Discussion of Cuis Smalltalk</a><br>
<b>Cc: </b><a href="mailto:JuanVuletich@zoho.com">Juan Vuletich</a>; <a href="mailto:mail@jaromir.net">
Jaromir Matas</a><br>
<b>Subject: </b>Re: [Cuis-dev] FW: FW: FW: Freezing UI - can't interrupt via Alt+.<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:black">Hi Jaromir,<br>
<br>
On 7/14/2022 4:49 PM, Jaromir Matas via Cuis-dev wrote: <o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Hi Juan,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Gosh, this is amazing! I couldn't wait to see :)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">I ran out of mean examples :D<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:black"><br>
Fun, Fun, Fun!<br>
<br>
<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:black">One observation though: Sometimes, although rarely and irregularly, this happens:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">I run an example (in the Workspace), e.g. this one:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">[1/0] fork.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">5 seconds asDelay wait.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">self error: 'error'<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">and then I move the first debugger window and close it before the 5 second delay expires and when the second debugger opens I get an MNU error concerning drawing - I'm enclosing a snip (if I knew how to file out
the debugger's stack contents I'd send it too). And the next time you run the same example it may happen again or may not... Can't figure out any pattern except you have to move the first debugger window before closing it.<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:black"><br>
Oh, yes. Letting the old Morphic process end by itself may mean that there is more than one process trying to draw the world. And if some higher priority process wakes up, maybe the other morphic process is scheduled next. Just pushed a couple of tweaks to
reduce the risk as much as possible.<br>
<br>
<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:black">--<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">One stupid question: How do you make the image download the latest changes you made at github? I thought this would work: World menu -> changes -> install new updates but it doesn't... Now I think it's maybe not
supposed to download from github but just locally from the CoreUpdates folder... Is that so?<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:black"><br>
Yes. The base image doesn't even include networking code. It will only access local files.<br>
<br>
<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:black">What I do now (sorry if it sounds too stupid) is I download a new image which contains the latest changes in the CoreUpdates folder already...<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">The thing is I'm on Windows and don't do any git stuff or any command line stuff ;) Is there a way for users like me to update easily?<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:black"><br>
The alternative would be to grab the update files from github using the web browser. Could be even more tedious that grabbing a full zip file each time. The alternative is to use git, of course. I use git in Windows each time I save new Cuis images, as it is
easier to run 32 bit systems than in Linux or MacOS. Just open the git bash and do git pull. Actually, I wouldn't be surprised if the Linux subsystem for Windows already includes git.<br>
<br>
<o:p></o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:black">--<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Well, actually, what would think about situations like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">[1/0] fork.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">[ 10000 factorial. Processor yield ] repeat<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">would you expect, or consider reasonable to expect, the UI to process the 1/0 exception during the long computation?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">I'd tend to say no but then when I look at this example:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">[1/0] fork.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">[ 10000 factorial. 5 seconds asDelay wait ] repeat<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">I'm not so sure... The delay blocks the UI and a thus a new UI is created etc. while in the former case yield just allows other processes of the same priority to run etc… which are implementation details…
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">And if you run the former example forked:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">[[1/0] fork.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">[ 10000 factorial. Processor yield ] repeat] fork<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">You won’t be surprised the 1/0 exception is executed immediately after the first yield. Which leads me closer to expecting the 1/0 exception appear after the first yield even in the former example. I believe the
computation’s result shouldn’t depend on whether it runs in the UI or not. <o:p>
</o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">I'm curious to know your opinion.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">Many thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:black">jaromir<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal"><span style="color:black"><br>
Interesting examples. I think there are arguments to support both sides. So, far, I'm OK with firing a new UI process if the current one is blocked, suspended or terminated. Likely the user is trying to recover control using cmd+. But starting a new UI process
only because the current one is busy, is something that would require making all morphic fully multithreading. I don't think the complexity is worth, at least unless we see a "real world" need.<br>
<br>
If the programmer started a long computation in the UI process by mistake, they can cmd + . to recover control, and then try something better (perhaps fork the workload). If they did it on purpose, well, then they actually asked for the UI to be unresponsive
during that time.<br>
<br>
If we changed this, not only the Morphic framework should be multithreading safe. Also all application code: Application level code could be busy updating data, while on a separate process the user tries to use it or modify it in some other way. We'd be forcing
all app developers to be "parallel processing aware", even if they are writing simple code. I prefer to let those, willing to do heavy processing -and- have a responsive UI at the same time, find a suitable design.<br>
<br>
Hope this makes sense to you.<br>
<br>
Cheers!<br>
<o:p></o:p></span></p>
<pre>-- </pre>
<pre>Juan Vuletich</pre>
<pre><a href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a></pre>
<pre><a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a></pre>
<pre><a href="https://github.com/jvuletich">https://github.com/jvuletich</a></pre>
<pre><a href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a></pre>
<pre><a href="https://independent.academia.edu/JuanVuletich">https://independent.academia.edu/JuanVuletich</a></pre>
<pre><a href="https://www.researchgate.net/profile/Juan-Vuletich">https://www.researchgate.net/profile/Juan-Vuletich</a></pre>
<pre><a href="https://patents.justia.com/inventor/juan-manuel-vuletich">https://patents.justia.com/inventor/juan-manuel-vuletich</a></pre>
<pre><a href="https://twitter.com/JuanVuletich">https://twitter.com/JuanVuletich</a></pre>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>