It means that static members of this class can operate smoothly through multiple threads. They don’t have anything that can cause problems when running concurrently or if they have a situation that can cause problems, they already have a mechanism that doesn’t let any problems occur. So you can access these members concurrently without fear.
But the members of the bodies are not guaranteed as thread safe. What does not matter in this case, since the class is static.
If it were an unstable class you could still use the instances concurrently if you provide mechanisms that ensure the proper functioning concurrently. Or you can use parallel but not concurrent.
Of course programming using threads it’s not something simple, you still need to know what you’re doing even though everything in class is thread safe.
Static classes are not used more than once in the application. Although nothing prevents it from being done, this does not seem to be the case, it seems to be something that should be unique in the application. Therefore, in general, it is not used with threads. At least it’s my understanding reading the little documentation. Take the example.
There is also information that the class is static, so there are no instances of it.
– Maniero
Well noted, the class statement defines it as static, so it is not possible to create instances of it. What’s more: in the statement in C++ there is still the flag
sealed
, which prevents it from being used as an ancestral class of other classes, that is, neither by making another class and inheriting it from it! I don’t remember C#anymore, but the C# statement doesn’t have this flag.– fbiazi
Because static classes are automatically
sealed
. And remember that that is C++/CLI, there is no pure C++ attribute.– Maniero