G
Guest
Hi,
I am using .NET 2.0.
Suppose I mark a static variable with the ThreadStatic attribute in a class.
From some method in the class, if I pass that variable to an object of
another class as an argument in a method, would it be maintained as a
reference in the other object ? Subsequently, if the second object spawns a
thread which also accesses this variable, would the two threads be working on
the same instance of the variable ? Or does the second thread get a copy of
the thread static variable ?
I am using .NET 2.0.
Suppose I mark a static variable with the ThreadStatic attribute in a class.
From some method in the class, if I pass that variable to an object of
another class as an argument in a method, would it be maintained as a
reference in the other object ? Subsequently, if the second object spawns a
thread which also accesses this variable, would the two threads be working on
the same instance of the variable ? Or does the second thread get a copy of
the thread static variable ?