[concurrency-interest] synchronized on construction

Jason Mehrens jason_mehrens at hotmail.com
Tue May 23 14:12:36 EDT 2006


Browsing over the java.util.Vector class I noticed that in the constructors, 
the initial writes to the internal data members (non-final and non-volatile) 
are not performed under a synchronized block.   The same is true for when a 
Vector is deserialized.  Where does happens-before edge occur so that other 
threads don't see uninitialized values of the internals?  The only happens 
before-edges I can think of are during handoff between threads or on the 
call to Thread.start().  Is how this class conforms to the JMM or is 
something else going on?

Thanks,

Jason Mehrens




More information about the Concurrency-interest mailing list