[concurrency-interest] concurrency puzzle
dcholmes at optusnet.com.au
Sun Sep 10 20:11:45 EDT 2006
> Ummm if the assignment occurs in the print method then the subsequent
> println must print 42 regardless because the assignment occurred
> in the same thread.
As Jeremy has been pointing out you need to see how multiple threads come to
access the instance of the class. What I wrote above is incorrect if the
instance was unsafely published because the write in the constructor due to
the initialization statement could "appear" after the assignment within the
Sorry for adding to the confusion.
More information about the Concurrency-interest