[concurrency-interest] a question about concurrent safe access

Larry Riedel larryr at saturn.sdsu.edu
Tue Sep 20 12:29:14 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?
>
> [...]
>
> 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.

A different kind of garbage from when an object which is not
thread-safe may in general violate its "invariants" when used
concurrently by multiple threads?


Larry



More information about the Concurrency-interest mailing list