[squeak-dev] The Inbox: Morphic-jar.2018.mcz
mail at jaromir.net
Wed Jul 6 12:19:10 UTC 2022
I’ve posted my reply in the RE: [squeak-dev] Freezing UI issue thread.
From: Marcel Taeumel<mailto:marcel.taeumel at hpi.de>
Sent: Wednesday, July 6, 2022 10:42
To: squeak-dev<mailto:squeak-dev at lists.squeakfoundation.org>
Subject: Re: [squeak-dev] The Inbox: Morphic-jar.2018.mcz
Hi Jaromir --
This looks a bit "too clever" for me.
Process simulation would not work, right? And if we argue that no one wants to simulate a Morphic UI process at that level, I would argue that no Morphic application code should wait for a custom semaphore in the UI loop. ;-) Let's not forget that CMD+Dot still works so that the application programmer can discover such a mistake.
The fact that we can actually closure the binding while creating it is nice, but do we have to rely on this really to fix our problem?
The issue is scattered already via #spawnNewProcessIfThisIsUI: and the debugger's errorWasInUIProcess resume logic. If we now obfuscate the that very simple main loop to support yet another edge case ... I hope we can do better. I don't yet see how.
Finally, I think you actually want to check
uiProcess == Project current uiProcess
would always be true at that point.
Am 06.07.2022 10:20:13 schrieb commits at source.squeak.org <commits at source.squeak.org>:
A new version of Morphic was added to project The Inbox:
==================== Summary ====================
Time: 6 July 2022, 10:19:54.175389 am
Add an "exit condition" to the UI loop to allow a former UI process to finish its last cycle and terminate gracefully. It allows to create a new UI without the need to explicitely terminate the old one because a UI process will terminate automatically once it's replaced by a new one. This change could allow UI proceses blocked on custom semaphores to continue waiting for a signal and finish their previous job (and terminate). Also, it prevents two UI processes to exist at the same time; only the one registered in the 'uiProcess' variable is allowed to cycle.
Please review for any potential drawbacks or conflicts I may have missed.
=============== Diff against Morphic-mt.2017 ===============
Item was changed:
----- Method: MorphicProject>>spawnNewProcess (in category 'active process') -----
uiProcess := [
+ [world doOneCycle. Processor yield. uiProcess isActiveProcess] whileTrue.
- [world doOneCycle. Processor yield ] repeat.
] newProcess priority: Processor userSchedulingPriority.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev