guile-devel
[Top][All Lists]
Advanced

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

Re: allocation within critical sections


From: Mike Gran
Subject: Re: allocation within critical sections
Date: Thu, 16 Feb 2012 18:46:02 -0800 (PST)

> From: Andy Wingo <address@hidden>

>>  Can you explain what happens here?  Is it a deadlock?  What’s at
>>  ports.c:575?
> 
> It was a deadlock, but I fixed it.  It was something that locked all
> weak sets, but while doing so allocated memory.  Allocating memory ran
> finalizers which tried to manipulate the port set, but that lock was
> already taken: deadlock.
> 
> The solution will be to run finalizers in a separate thread, as the JVM
> does.

As an aside, I can get a similar sort of deadlock during garbage
collection of SMOBs if my smob_free function calls a scheme function.
But the manual does note that you should not call any functions in 
SMOB GC finalizers, so that wouldn't happen if I actually followed the
instructions.

-Mike



reply via email to

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