Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top