what is the best way to store some variable local to each thread?
Another option in the case that scope is an issue you can used Named Data Slots e.g.
//setting
LocalDataStoreSlot lds = System.Threading.Thread.AllocateNamedDataSlot("foo");
System.Threading.Thread.SetData(lds, "SomeValue");
//getting
LocalDataStoreSlot lds = System.Threading.Thread.GetNamedDataSlot("foo");
string somevalue = System.Threading.Thread.GetData(lds).ToString();
This is only a good idea if you can't do what James Kovacs and AdamSane described