[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: catching scm_without_guile badness
From: |
Ludovic Courtès |
Subject: |
Re: catching scm_without_guile badness |
Date: |
Mon, 11 Aug 2008 12:32:23 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Hi Guilers!
"Neil Jerram" <address@hidden> writes:
> 2008/7/31 Andy Wingo <address@hidden>:
>> 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.