Originally posted by Naseem Khan:
There is a Test class that defines instance variable. If you have more than one thread and each one is operating on different instance of Test, will that instance variable still be a shared resource? I mean will there be any race condition in this case.
Instance variables are just that -- instance variables. Each instance of the (Test) class that has that variable will have its own instance of the variable. Changing the reference in one Test class will *not* affect another instance of the Test class.
As for whether "there be any race condition", it's not that simple. While each instance of the Test class may have its own copy of the variable, the variable may be a class that contain static variables. So, any race condition is still dependent on how the instance variable is used.
Henry