thread.d "Unable to load thread context"

Benjamin Thaut code at benjamin-thaut.de
Tue Jun 28 11:46:01 PDT 2011


Am 28.06.2011 18:09, schrieb Sean Kelly:
> Have you tried running the latest runtime from git?  I fixed a rather nasty threading bug since the last release that could be related.
>
> Sent from my iPhone
>
> On Jun 28, 2011, at 6:47 AM, Benjamin Thaut<code at benjamin-thaut.de>  wrote:
>
>> I'm my current project, which is a relatime 3d space shooter I'm using a lot of C libraries (SDL, OpenGL, OpenAL, SDL_Image, Assimp, etc.)
>> As the gc would take to much time when it runs only once in a while I'm performing a full collect after a frame has been rendered.
>> Now once in a while, sometimes after 30 seconds, sometimes after 20 minutes, the D runtime throws the "Unable to load thread context" exception. My debugger tells me that the main thread is currenlty performing a full collection when that happens.
>> A few other threads are waiting for single or multiple objects (on windows that is). A OpenGL thread runs the ntdll!ZwQueryInformationThread (I'm using a nvidia card so it's the nvidia OpenGL implementation) and one of my threads waits for a semaphore with a tryWait.
>>
>> My application runs 3 thraeds.
>> -A main thread where the renderer runs in. This thread makes all the OpenGL calls.
>> -A extractor thread that extracts relevant data for the renderer from the game thread.
>> -The game thread that actually performs the game simulation. This thread makes calls to the OpenAL api.
>>
>> Now I'm wondering why this happens. Is this connected to OpenGL?
>> Is it not a good idea to call the gc collect manually?
>> Isthe thread that is waiting for the semaphore the problem?
>>
>> Any help would be appreciated.
>> --
>> Kind Regards
>> Benjamin Thaut

I just build dmd, druntime and phobos fromt the latest git revision (as 
druntime does not build with dmd 2.053). The game does build with it, 
but as soon as it starts a exception gets thrown in the GC which does 
not get cought by any of my catch blocks.
Maybe I did something wrong building dmd, is there a guide somewhere?

-- 
Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list