[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: allocation within critical sections
From: |
Andy Wingo |
Subject: |
Re: allocation within critical sections |
Date: |
Fri, 17 Feb 2012 09:16:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
On Fri 17 Feb 2012 03:46, Mike Gran <address@hidden> writes:
>> 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.
Any Scheme function? With Guile 2.0? It should be possible to call
arbitrary code from finalizers, if we call finalizers from a separate
thread.
Andy
--
http://wingolog.org/
- allocation within critical sections, Andy Wingo, 2012/02/09
- Re: allocation within critical sections, Andy Wingo, 2012/02/13
- Re: allocation within critical sections, Ludovic Courtès, 2012/02/16
- Re: allocation within critical sections, Andy Wingo, 2012/02/16
- Re: allocation within critical sections, Mike Gran, 2012/02/16
- Re: allocation within critical sections,
Andy Wingo <=
- Re: allocation within critical sections, Mike Gran, 2012/02/17
- Re: allocation within critical sections, Andy Wingo, 2012/02/17
- Re: allocation within critical sections, Ludovic Courtès, 2012/02/17
- Re: allocation within critical sections, Andy Wingo, 2012/02/19
- Re: allocation within critical sections, Ludovic Courtès, 2012/02/19
- Re: allocation within critical sections, Andy Wingo, 2012/02/19
- Re: allocation within critical sections, Andy Wingo, 2012/02/24