views:

82

answers:

2

I have a .NET module that I need to call from an instantiated class. Can I count on only one object at a time being able to access the functions in a module (something like instantiating a module) or will I need to look at locking within the class? I can't seem to get a clear answer to this anywhere. Thanks!

+4  A: 

It depends entirely on the implementation of the classes in the module. As a general rule, though, if they're not advertised as thread-safe, they're probably not.

Ben M
As an addition: MSDN documentation nearly always specifies thread safety information for all classes in the base class library.
Reed Copsey
+2  A: 

The term "Module" typically refers to a binary file, and they are merely containers of types. These types may or may not be thread-safe.

In general, no types in .NET are thread-safe unless they are made thread safe.

Fredrik Mörk