guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: catching scm_without_guile badness


From: Neil Jerram
Subject: Re: catching scm_without_guile badness
Date: Sat, 2 Aug 2008 19:15:06 +0100

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.  Assuming you now (or soon) have repo access, can
you proceed with committing this yourself?  (Both master and 1.8
branch, I would say.)

> 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.

Regards,
       Neil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]