Riporto AS IS il post che ritengo molto interessante per chi scrive applicazioni multi-threaded.
The Whidbey RTM implementation of Thread.GetData/Thread.SetData has several scalability issues caused by global locks being taken. The appdomain-global lock taken in LocalDataStore.SetData is one of them. There is another global lock taken in ThreadNative::GetDomainLocalStore that is even worse since it is process-global.
The best workaround is to use [ThreadStatic] variables instead of Thread.GetData/Thread.SetData:
[ThreadStatic]
static Object foo;
[ThreadStatic] variables do not suffer from the contention issues. Moreover [ThreadStatic] variables are several times faster compared to Thread.GetData/Thread.SetData.