[concurrency-interest] synchronized constructors

Boehm, Hans hans.boehm at hp.com
Fri Dec 16 16:33:07 EST 2011


As far as I can tell from the copyright notice and content, the memory model spec in that book hasn't been updated since the 2005 memory model revision.  I believe it should be ignored for this discussion.

Hans

> -----Original Message-----
> From: concurrency-interest-bounces at cs.oswego.edu [mailto:concurrency-
> interest-bounces at cs.oswego.edu] On Behalf Of Zhong Yu
> Sent: Friday, December 16, 2011 11:04 AM
> To: Roland Kuhn
> Cc: concurrency-interest
> Subject: Re: [concurrency-interest] synchronized constructors
> 
> I can only reason concurrency based on JMM (as in the Java Language
> Spec); beyond that I have no idea.
> 
> My understanding is that JMM allows such reordering (in effect)
> 
> Zhong Yu
> 
> On Fri, Dec 16, 2011 at 3:48 AM, Roland Kuhn <rk at rkuhn.info> wrote:
> > As I was recently made aware: the rules for write reordering are not
> as weak as you think.
> >
> >
> http://java.sun.com/docs/books/jvms/second_edition/html/Threads.doc.htm
> l#24432
> >
> > Section 8.8 of the JVM spec requires that a write cannot be moved
> earlier across a "lock" operation. This means that a synchronized {} in
> the constructor solves the issue.
> >
> > Regards,
> >
> > Roland
> 
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest



More information about the Concurrency-interest mailing list