Passing references of ThreadStatic variables

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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top