[squeak-dev] Re: Using Semaphores in drawing code

Ben Coman btc at openinworld.com
Fri Aug 26 06:12:32 UTC 2016


On Thu, Aug 25, 2016 at 6:04 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> Marcel,
>
> if we could think of a good way to detect the lockup we should definitely
> add it.
>
> Raising a signal every time a process waits on a semaphore is definitely not
> a good way.
>
> Having a watchdog process monitoring the UI process sounds a lot better. But
> maybe there are other ideas.
>
> If we had a concrete proposal this might become a more fruitful discussion
> :)
>
> - Bert -

>From my industrial automation experience, we'll often set up
cross-monitoring watchdogs between two PLCs [1] in different parts of
the plant, one setting a bit to 1 and the other setting a bit to 0.
If either sees this watchdog-toggle not change for a defined period, a
problem is identified with the other.  In Squeak's case, the Morphic
UI process would cross monitor the watchdog process in case it
terminates for some reason.

When the watchdog process notices a problem, I guess it would:
a. check if the process is on a Semaphore wait queue and remove it
b. inject an Exception into the UI process that would operate
something like #terminate, but walk the stack back to an appropriate
handler and then continue.

This could cover more than being blocked on Semaphores, and also
scenarios where a long running calculation gets out of control, and
also some newcomer errors like  "[true] whileTrue" in the Workspace.
Although sometimes you want a long running calculation executed from
the Workspace.

So my questions are:
1. Where would be a good place for the watchdog-toggle variable to live?
2. How can one process inject an Exception into another process?

[1] https://en.wikipedia.org/wiki/Programmable_logic_controller.

cheers -ben

>
> On Thu, Aug 25, 2016 at 9:05 AM, marcel.taeumel <Marcel.Taeumel at hpi.de>
> wrote:
>>
>> Hi Levente,
>>
>> with "expensive" you mean "not optimized", right? I am asking because we
>> use
>> our exception mechanism for accessing source code and I also know about a
>> game that used Notifications as a core communication concept in a game.
>> :-)
>>
>> --> CurrentReadOnlySourceFiles
>>
>> Best,
>> Marcel
>
>
>
>


More information about the Squeak-dev mailing list