M
mflanagan
I have unmanaged C++ program that will load a managed C++ dll and then
call a function in that dll. The managed C++ routine will call some C#
routines. The unmanaged C++ main program will make these calls (to
the managed C++ dll) many times, from many different threads. Each
thread will do a LoadLibrary, call one C++ routine in the managed dll,
and upon return, unload the library and exit.
I'm concerned about class variables (static) in my C# classes. I would
like such variables to have a scope (if that's the right word) of the
thread, or the time between load- and unload-library.
How do static class variables work in this regard? I *don't* want to
share these members across threads. And, if the same thread does a
"load-library; call function_in_dll(); unload library"
twice, I'd rather not have the second invocation of function_in_dll()
see the class variable from the first invocation.
Am I confusing the fact that .NET uses dlls with the usage of non-.NET
dlls?
Thanks for any insights into this.
call a function in that dll. The managed C++ routine will call some C#
routines. The unmanaged C++ main program will make these calls (to
the managed C++ dll) many times, from many different threads. Each
thread will do a LoadLibrary, call one C++ routine in the managed dll,
and upon return, unload the library and exit.
I'm concerned about class variables (static) in my C# classes. I would
like such variables to have a scope (if that's the right word) of the
thread, or the time between load- and unload-library.
How do static class variables work in this regard? I *don't* want to
share these members across threads. And, if the same thread does a
"load-library; call function_in_dll(); unload library"
twice, I'd rather not have the second invocation of function_in_dll()
see the class variable from the first invocation.
Am I confusing the fact that .NET uses dlls with the usage of non-.NET
dlls?
Thanks for any insights into this.