简体   繁体   中英

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!

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM