[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Threads and dynamic-wind still problematic
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] Threads and dynamic-wind still problematic |
Date: |
Thu, 5 Mar 2009 10:53:44 +0100 |
On Mon, Mar 2, 2009 at 9:48 PM, Peter Bex <address@hidden> 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