Question : Multithreading Through a Wrapper DLL

I've got a question about thread safe programming.  I'm a business application developer and don't really understand all of the implications of thread-safe programming.  I've got a customer who is using a third-party DLL which is thread-safe/multithreaded and stateful.  You can open many independent sessions in this DLL from many different calling programs and each session gets an integer handle that you use as part of subsequent calls to the API.  The DLL keeps all of these concurrent sessions on multiple threads separate and everything works great.

So here is my problem/issue/question.  My customer wants to have a wrapper written around certain parts of the API of this third-party DLL.  The point of the wrapper is just to reconfigure the function arguments.  The DLL uses standard C calling conventions and relies heavily on C structs.  The DLL is not COM or anything, just straight-forward static C functions.  My customer wants to access the API using a language which can't handle structs properly.  Therefore, they want a wrapper DLL that rejigs the structs as independent function arguments using basic data types.  This all seems pretty simple, just create a new DLL that wraps the third-party DLL with some static functions that do the translations to and from structs and basic types.  

What I don't know is this:  Will there be any threading complications if I build this simple DLL with straight forward static wrapper functions?  Do I need to do anything to avoid problems in a multi-threaded application?

Answer : Multithreading Through a Wrapper DLL

>>the third-party DLL definitely has data shared across multiple threads and
>>even processes, I think.

Then it also has means to ensure that these don't hamper each other, and since you are only wrapping the calls, you won't interfere with these mechanisms.

>> It really is this simple, isn't it?

If it's only local variables you deal with - yes it is. Local variables are allocated on the stack, and since each thread has its own stack, this is guaranteed to be safe - thread-safe, literally (pardon the pun ;o)
Random Solutions  
 
programming4us programming4us