GC + malloc/free = deadlock

simendsjo simendsjo at gmail.com
Mon Apr 23 06:48:22 PDT 2012


On Mon, 23 Apr 2012 15:44:01 +0200, Benjamin Thaut  
<code at benjamin-thaut.de> wrote:

> Am 23.04.2012 14:36, schrieb Kapps:
>> On Monday, 23 April 2012 at 12:11:19 UTC, Benjamin Thaut wrote:
>>>
>>> If what you are saying is true, the deadlock must happen somewhere
>>> else. This was kind of a assumption because the deadlock happend after
>>> I added all the malloc / free calls. Because all the threads are
>>> stopped when this happens I can't really debug this, because the
>>> Visual Studio debugger tells me that it can not debug any thread but
>>> the one that is currently running the GC.
>>>
>>> Kind Regards
>>> Ingrater
>>
>> Are these threads created by core.thread.Thread, or are they created
>> through different means such as native OS calls or a C api? If the
>> latter, you have to register them with the runtime (I think it was
>> something like Thread.attachThis), otherwise issues like this will  
>> happen.
>
> No all threads are created via core.thread.Thread. There are however  
> some threads (OpenGL / OpenAL) that I do not create.

I've had problems using attachThis() on threads created in C.
Look at  
http://www.digitalmars.com/d/archives/digitalmars/D/learn/GC_collecting_too_much_.._33934.html
No one has answered though..


More information about the Digitalmars-d mailing list