On Mon, Mar 2, 2009 at 9:48 PM, Peter Bex <[email protected]> wrote:
> Hi,
>
> I just got bitten by this problem:
> http://lists.gnu.org/archive/html/chicken-users/2008-04/msg00023.html
>
> I'm increasing and decreasing a mutex value based on how many threads
> are doing some work.  When they stop working, the mutex is decreased
> and when they start, the mutex is increased.  I decided to wrap the
> thunk that does the work in a dynamic-wind to protect it from escape
> continuations being called, and from exceptions.
>
> However, it turns out that an exception thrown in a thread simply
> terminates the thread instead of unwinding the stack.  The same does not
> happen in the primordial thread:
>

I think the SRFI-18 specification isn't quite clear about this. It
only specifies
that the default exception handler stores the exception in the thread and
terminates it (so that a later "thread-join!" can pick it up), but whether that
exception-handler unwinds dynamic-wind thunks isn't clear to me.

I'll ponder about this.


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to