[concurrency-interest] a question about concurrent safe access

Brian Goetz brian at quiotix.com
Tue Sep 20 10:48:16 EDT 2005


>>But what can happen if a field is used in a multithreaded environment
>>and it isn`t synchronized or volatile. Could you get some serious
>>vm-errors (or totally unacceptable behaviour of the program)? Or just an
>>old reference?
> 
> The answer is C: Just an old reference

More precisely:

You can get an old or new reference to the object being referenced.  But 
in the event you see the new reference, the state _of that referenced 
object_ may still be garbage unless that object it itself immutable or 
thread-safe.



More information about the Concurrency-interest mailing list