GC + malloc/free = deadlock

Benjamin Thaut code at benjamin-thaut.de
Mon Apr 23 06:44:01 PDT 2012


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.


More information about the Digitalmars-d mailing list