Re: Multiple instances of a single DLL
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Wed, 2 Jan 2008 14:37:58 -0600
"Serge Wautier" <serge@xxxxxxxxxxxxxxxxxx> wrote in message
news:%23c9yN5GTIHA.5288@xxxxxxxxxxxxxxxxxxxxxxx
Stefan, Nikolaos,
Thanks for your replies.
Yes, my dll contains global data, which is the root of my problem.
Sorry, I should have been more specific about it.
I initially ruled out TLS for a reason that I now realize was stupid. I'll
investigate that route.
Do you have the DLL source code? If so, eliminate your global variables by
moving them into a "context" struct which the caller must provide.
If you don't have the DLL source code, then you basically will require a
separate process to host each instance of the DLL, it's the only way (short
of creating a custom loader that processes fixups) for the data addresses
placed in the code by the compiler to refer to different instances, because
each process gets its own page table. TLS wouldn't help you.
I don't think TLS is appropriate for your problem. Sounds reminiscent of
"When all you have is a hammer everything looks like a nail".
.
- Follow-Ups:
- Re: Multiple instances of a single DLL
- From: Nikolaos D. Bougalis
- Re: Multiple instances of a single DLL
- From: Serge Wautier
- Re: Multiple instances of a single DLL
- References:
- Re: Multiple instances of a single DLL
- From: Stefan Kuhr
- Re: Multiple instances of a single DLL
- From: Nikolaos D. Bougalis
- Re: Multiple instances of a single DLL
- From: Serge Wautier
- Re: Multiple instances of a single DLL
- Prev by Date: Re: C# .NET EXE using native Win32 DLL with automatic TLS
- Next by Date: Re: Multiple instances of a single DLL
- Previous by thread: Re: Multiple instances of a single DLL
- Next by thread: Re: Multiple instances of a single DLL
- Index(es):
Relevant Pages
|