Re: Multiple instances of a single DLL
- From: "Serge Wautier" <serge@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 1 Jan 2008 13:03:12 +0100
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.
Thanks for pointing out the limit on threads per process.
Serge.
http://www.apptranslator.com - Localization tool for your C/C++ and MFC applications
"Nikolaos D. Bougalis" <nikb@xxxxxxxxxxxxx> wrote in message news:_9hej.26808$db7.8758@xxxxxxxxxxxxxxx
Stefan Kuhr wrote:Hello Serge,
Serge Wautier wrote:<snip>
The code of the data logger can also be compiled as a DLL and loaded by a Windows exe that acts as a virtual machine to simulate the device. Very helpful for basic debugging.
Now I want to load test the server (the device sends its info to a web server by GPRS).
My idea is to create a bunch of threads. Each thread is a single virtual machine, therefore owns a copy of the data of one DLL 'instance'.
As long as your DLL doesnt have per-DLL-instance data (read: "globals"), you need not make copies of your DLL to simulate your virtual machine. However, if your DLL uses globals, there is no other way than what you already proposed.
Please don't answer questions to which you don't know the answer to. That's _EXACTLY_ what TLS is for. You can find out more about how it works and how to use it on the nice MSDN page that explains how it works: http://msdn2.microsoft.com/en-us/library/ms686749.aspx.
-n
.
- Follow-Ups:
- Re: Multiple instances of a single DLL
- From: Ben Voigt [C++ MVP]
- 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
- Prev by Date: Re: Multiple instances of a single DLL
- 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
|