ThreadStatic v.s. ThreadLocal: is generic better than attribute?

Something the blog post noted in the comments doesn’t make explicit, but I find to be very important, is that [ThreadStatic] doesn’t automatically initialize things for every thread. For example, say you have this: [ThreadStatic] private static int Foo = 42; The first thread that uses this will see Foo initialized to 42. But subsequent … Read more