News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Thread Safe DLL

Started by rck8, April 05, 2005, 08:15:00 AM

Previous topic - Next topic

rck8

I'm working on a DLL using MASM32 and I'm at the point of asking myself what I might have to do to be thread safe. The DLL allocates structures containing pointers and data based on caller parameters. I have a block of DWORD's in the .data section that contain pointers to all the structures allocated and return a handle associated with one of those structure pointers. The calling sequence is basically, init/acquire, process 1 or more times, release. Is it safe to assume that using the .data pointer block is acceptable under all circumstances?

Rick

hitchhikr

You may eventually want to allocate/free the memory you use / thread in DLL_THREAD_ATTACH / DLL_THREAD_DETACH or use thread local storages.