class Program1 { [ThreadStatic] static int x; static void Main(string[] args) { Program1 p1 = new Program1(); x = 10; // initial value new Thread(delegate() { p1.GetValue(); }).Start(); new Thread(delegate() { p1.SetValue(); }).Start(); new Thread(delegate() { p1.GetValue(); }).Start(); Console.WriteLine(Program1.x); } void SetValue() { x = 100; Program1 p2 = new Program1(); x = 50; p2.GetValue(); } void GetValue() { Console.WriteLine(x); } }