Say that a third-party DLL X has a global variable G
I am writing two separate DLLs (like plugins for the application) P1 and P2 , which dynamically load X.
During the application, two of my plugins P1 and P2 are loaded, so both are loaded at the same time.
Does this mean that I have one instance of G or two?
change
The X usage scenario is a 3D rendering engine that has singlet packages wrapping system resources, it is simply not designed to wait for multiple instances in the process - you can run 2 X strong> applications, but the attempt to initialize X twice in one application will be ruined. Plugins use X , but they will be deployed as separate installers, they will not know about each other and will not use the same X .dll file - typical for each plugin they have their own directory for storing the necessary resources and DLLs.
source share