ThreadStatic Modified with Static C#

The ThreadStaticAttribute is only designed to be used on static variables, as the documentation points out. If you use it on an instance variable, I suspect it will do precisely nothing.


In the first case it would probably be ignored, whereas in the second case you are correct, one instance per thread.


In Microsoft Docs, it says:

Indicates that the value of a static field is unique for each thread.

So I guess your first case is incorrect. The attribute will probably be ignored.