tekiegreg
tekiegreg

Reputation: 1707

Are .NET modules thread safe?

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!

Upvotes: 0

Views: 306

Answers (2)

Fredrik Mörk
Fredrik Mörk

Reputation: 158319

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.

Upvotes: 2

Ben M
Ben M

Reputation: 22492

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.

Upvotes: 4

Related Questions