Hi Guilers!

"Neil Jerram" <[EMAIL PROTECTED]> writes:

> 2008/7/31 Andy Wingo <[EMAIL PROTECTED]>:
>> Hi,
>>
>> I just spent a couple days tracking down a bug in my code that was due
>> to calling scm_without_guile when I wasn't actually in Guile. This
>> exhibited itself as a deadlock at some point in the future when a
>> scm_without_guile that was lower on the stack exited, it tried to take
>> the heap lock when the first scm_without_guile had already,
>> unnecessarily taken it.
>>
>> The solution of course is to not call scm_without_guile when you're not
>> in guile. (My problem was actually that I had failed to call
>> scm_with_guile when re-entering into some scheme code.) The following
>> patch aborts if suspend() is called, but the thread was not in guile
>> mode. Does it make sense to yall?
>
> Well it does to me.

+1.

>> I guess we should benchmark it, it's a
>> pretty hot spot.
>
> I don't think so.  I don't think one pointer reference will be
> significant next to mutex locking.

Indeed (not to mention the `setjmp ()' call).

Thanks,
Ludovic.



Reply via email to