The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: rck8 on April 05, 2005, 08:15:00 AM

Title: Thread Safe DLL
Post by: rck8 on April 05, 2005, 08:15:00 AM
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
Title: Re: Thread Safe DLL
Post by: hitchhikr on April 05, 2005, 09:43:10 AM
You may eventually want to allocate/free the memory you use / thread in DLL_THREAD_ATTACH / DLL_THREAD_DETACH or use thread local storages.