|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
threads and loading dll several time in different AppDomainHello,
I have an old style C DLL that is not thread safe (make usage of global variables). However, I would need to use it in a multithreaded environment. I'm not too sure if this would solve my problem: Whenever a thread is started, load my dll in separated AppDomain (name will be dynamically allocated based on thread ID,...) Thanks, José
Show quote
"José Joye" <jose.joye__KILLTHESPAMS__SMAPSEHTLLIK__@bluewin.ch> wrote in Regular DLL's are not AD aware, more they are only loaded once in the message news:urMbgycIGHA.3000@TK2MSFTNGP14.phx.gbl... | Hello, | | I have an old style C DLL that is not thread safe (make usage of global | variables). | However, I would need to use it in a multithreaded environment. I'm not too | sure if this would solve my problem: | | Whenever a thread is started, load my dll in separated AppDomain (name will | be dynamically allocated based on thread ID,...) | | Thanks, | José | | calling process, as such it makes no sense to create separate AD's to load them. Not sure what problem you have (or think you might have), but if you have to call into non thread-safe code, you will have to restrict the number of caller to 1 at any time using locking. Willy. |
|||||||||||||||||||||||