[Pharo-project] Building a run loop that can continue after an unhanded exception

Frank Shearar frank.shearar at gmail.com
Fri Sep 7 08:02:50 EDT 2012

On 7 September 2012 12:29, Joe Rickerby <joe.rickerby at square-i.net> wrote:
> I have a solution however! Each timer on the run loop runs its action in a fork. This way any exception raised cannot unroll the stack to outside my run loop code.

Right. That's effectively identical to using a delimited continuation:
that marks the stack such that when you cut the continuation you can't
capture past the stack marker. [1]

The problem you might have is that the actions, being forked, run in a
separate Process. That means you have to worry about synchronising -
accessing common state from two actions (that are, of course, now
running in parallel).


[1] http://okmij.org/ftp/continuations/green-fork.html

> On 7 Sep 2012, at 12:24, Joe Rickerby <joe.rickerby at squaregroup.co.uk>
>  wrote:
>> Not really. Proceed would take me back to where the exception was signalled. I want to resume at the point of the catch of the exception, no matter what happens regarding the exception.
>> On 7 Sep 2012, at 09:40, Henrik Sperre Johansen <henrik.s.johansen at veloxit.no> wrote:
>>> On 07.09.2012 10:17, Joe Rickerby wrote:
>>>> Hi all,
>>>> I'm having a problem trying to build a run loop. If an exception is signalled within one of the run loop tasks, the exception escapes through the loop and terminates the process.
>>>> I know I can catch the exception, and do something like print the message on the Transcript, but I was hoping to build something that was more helpful in development, allowing me to look through the stack, but if I press 'abandon' on that dialog, the run loop would continue from where I caught the exception.
>>> Isn't that exactly what happens if you don't handle the error, and use the proceed button in (pre and normal) debugger windows?
>>> Cheers,
>>> Henry

More information about the Pharo-dev mailing list