Re: JavaMemoryModel: Idiom for safe, unsynchronized reads

From: Joshua Bloch (jbloch@eng.sun.com)
Date: Sat Jul 03 1999 - 01:51:09 EDT


Bill,

  I did not mean to indicate that making the world safe for the two
different idioms (construct-publish and construct-initialize-publish) were
truly identical, but that they were probably of comparable difficulty, and
that any solution to the former could easily be turned into a solution to
the latter. I still believe this to be the case.

   In particular, I believe that padding to the next cache line in the
nursery isn't sufficient to rehabilitate the former (construct-publish)
idiom. Consider Strings: they contain an array that must be modified after
it is created. If I can get a reference to a String that contains a
(private) reference to an array that appears not to be in its correct state,
I'm hosed.

                      Josh

-------------------------------
This is the JavaMemoryModel mailing list, managed by Majordomo 1.94.4.

To send a message to the list, email JavaMemoryModel@cs.umd.edu
To send a request to the list, email majordomo@cs.umd.edu and put
your request in the body of the message (use the request "help" for help).
For more information, visit http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:15 EDT