threads and loading dll several time in different AppDomain

  • Thread starter Thread starter José Joye
  • Start date Start date
J

José Joye

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é
 
message | 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é
|
|

Regular DLL's are not AD aware, more they are only loaded once in the
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.
 
Back
Top