Re: Using TLSAlloc to read data into a DLL
In that case you _do_not_ want TLS! It _does_not_ allow access
to the same data to different threads - by design!
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:ecyKIp%23SIHA.1924@TK2MSFTNGP06.phx.gbl...
"Sanjay" <sanjay.gangadhara@gmail.com> wrote in message
news:98123adf-deae-4300-ac94-e51386c97a95@i29g2000prf.googlegroups.com
Thanks for your response. I was a bit unclear in my earlier message,
which may or may not affect your answer. The DLL I am building is
multi-threaded. I want to be able to read in the data during the
DLL_PROCESS_ATTACH, as you indicate (when the DLL is first loaded). I
then want this data to be available to other threads of the DLL, which
may be called at various times. I thought that you would need to use
TlsAlloc, etc. to be able to do this - that global variables are not
passed between threads. Is this correct?
This is incorrect. All threads have access to global variables. Just do
it, you don't need anything special.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925