I agree with Doug. The problem is rare, and if, as Josh suggests, the premium
is on minimizing language changes, I don't see why a language change is
I think it is dangerous to throw in lots of extra synchronization in the hopes
that this will make some problems go away. While the obvious implementations
of object initialization would require a barrier on a weak memory model
machine, requiring the synchronization precludes optimizations that anyone
might come up with in the future.
Throwing an implicit barrier on every constructor is also counter to a
fundamental aspect of the Java design -- namely that the programmer gets to
choose where synchronization is applied and where it isn't. I don't think that
turned out to be a good approach, but given that it is what Java did, it seems
it ought to be applied uniformly.
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:29 EDT