Sign in to follow this  
sascoo

Unload dll

Recommended Posts

So I am currently debugging an OpenGL/DirectX game engine I have been working on for quite a while and have come up with a problem. I have the engine set up so that it can switch between the two modes at run-time and I noticed that for each time i switch from OpenGL to DirectX, a new thread gets spawned. I assume that the threads are slowing down my frame rate and are probably not good overall. I also found that this dll igdumd32.dll may be associated with the new threads. The dll has to do with graphics acceleration for an intel chipset. Is this dll my problem or is it a DirectX dll and if so, how can I unload them? Thanks, John

Share this post


Link to post
Share on other sites
Sounds like a problem with your drivers to me. When you "switch between modes", do you properly release all memory associated with your OpenGL or Direct3D context? Do you have your OpenGL and D3D code in the one EXE, or are you using DLLs for renderers or something?

Share this post


Link to post
Share on other sites
I am using a single exe. When I switch between OpenGL and DirectX I delete the graphics object associated with the renderer. With DirectX I release the LPDIRECT3DDEVICE9 and LPDIRECT3D9. In OpenGL I release HGLRC and HDC. I know the problem is with the DirectX because every time I switch to that, it adds a new thread.

This is what I ended up with when I stopped my program after switching back and forth a few times.

The thread 'Win32 Thread' (0x1f0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xa38) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x13dc) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xd14) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x564) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1088) has exited with code 0 (0x0).
The program '[3788] Engine.exe: Native' has exited with code 0 (0x0).


When I don't switch, it will only close two threads at the end of the execution...

Is there any way I can see what dll each thread is associated with?

Share this post


Link to post
Share on other sites
Alright, I wasn't watching the output window during execution. It is closing most of the threads during run-time. It always closes with three threads when I switch to gl and back to dx. If I don't switch it closes with only two threads. I know that there is a problem because my framerate drops by 20 when I render with dx after switching. I am using a very low end system so I am wondering if I should even worry about this extra thread since during use, the probability of someone switching between gl and dx is very small...

I am using a core2 at 1.66 GHz, gig and a half of ram, Intel Mobile 945gm express for my graphics card -- smoking system eh? ;)

Share this post


Link to post
Share on other sites
Well, I was curious because sometimes the graphics driver will create a thread behind your back to do some work (their way of trying to extract some parallelism from strictly single threaded games), I thought maybe that was what you were seeing.

Share this post


Link to post
Share on other sites
Yeah, that's what I am thinking it is, but it looks as if it is creating two instances... Whatever, I have much bigger issues to worry about right now then an extra graphics thread. Thanks for your help though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this