For many classes in the .NET frameworks, MSDN describes thead safety as:

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

How is that implemented? is there a syntactic sugar that happens there? or is it implemented inside the class in some way?

Thanks.

有帮助吗?

解决方案

That is just an implementation detail of those classes. It just means that the developers for those static methods took care of any thread-safety issues.

It is not a language or framework feature that static methods are thread-safe.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top