On 7 September 2012 14:27, Joe Rickerby <[email protected]> wrote:
> I'm actually doing forkAndWait on the timer actions to prevent any 
> synchronisation problems, and to prevent me spawning too many processes and 
> bringing down the system :/

Well, that would work. Have you thought of invoking each action in an
[action value] on: Exception do: [:e | "see later"] ? That would
prevent any exceptions/errors/notifications at all from breaking the
run loop.

In the "see later" part you could do tricky things like capture the
stack for inspection, via #signalerContext, if I recall correctly.

frank

> On 7 Sep 2012, at 13:02, Frank Shearar <[email protected]> wrote:
>
>> On 7 September 2012 12:29, Joe Rickerby <[email protected]> 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).
>>
>> frank
>>
>> [1] http://okmij.org/ftp/continuations/green-fork.html
>>
>>> On 7 Sep 2012, at 12:24, Joe Rickerby <[email protected]>
>>> 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 
>>>> <[email protected]> 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
>>>>
>>>
>>>
>>>
>>
>>
>
>
>

Reply via email to