I'm new to DLL coding. I wrote a DLL and an application to use it in Studio 2008 Express edition under Vista, but every instance of the application is loading its own copy of the DLL (!) - at least according to task manager...
Can't figure out why.... this happens whether I run it from DevStudio or
as a standalone.
Help....
DLL problem in DevStudio 2008
Started by Hawkwind, Jan 16 2008 12:09 AM
5 replies to this topic
#1
Posted 16 January 2008 - 12:09 AM
#2
Posted 16 January 2008 - 06:54 AM
DLLs save disk space, not memory space (*). Every application will load its own instance and link with it.
In 16-bit Windows (prior to 95) DLLs were shared in memory. This caused a lot of problems with static data that was modified by more than one application. 32-bit versions of Windows can handle much more virtual and physical memory, so having separate instances solved the problem.
(*) Actually they can help save memory space. If your engine supports both DirectX and OpenGL, it only has to load one of the renderer implementations.
In 16-bit Windows (prior to 95) DLLs were shared in memory. This caused a lot of problems with static data that was modified by more than one application. 32-bit versions of Windows can handle much more virtual and physical memory, so having separate instances solved the problem.
(*) Actually they can help save memory space. If your engine supports both DirectX and OpenGL, it only has to load one of the renderer implementations.
#3
Posted 16 January 2008 - 07:51 AM
Nick said:
Every application will load its own instance and link with it.
Surely code-only sections are still shared in memory, right? It's only the data sections and heap that need to be instanced per process.
reedbeta.com - developer blog, OpenGL demos, and other projects
#4
Posted 16 January 2008 - 10:11 AM
Even data can be shared if you put it in a shared data section
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.
-
Currently working on: the 3D engine for Tomb Raider.
#5
Posted 16 January 2008 - 02:24 PM
Reedbeta said:
Surely code-only sections are still shared in memory, right? It's only the data sections and heap that need to be instanced per process.
#6
Posted 16 January 2008 - 06:02 PM
Surely there must be a way to make the DLL shared ? - I thought that was the whole idea, otherwise what would be the point of writing re-entrant code in a DLL ?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












