ThreadStatic vs ThreadLocal<T>
Occasionally you might want to make the value of a static or instance field local to a thread (i.e. each thread holds an independent copy of the field), what you need in this case, is a thread-local storage. In C#, there are mainly two ways to do this. ThreadStatic You can mark a field with …