[concurrency-interest] a question regarding thedouble-checke dlocking

Jeremy Manson jmanson at cs.purdue.edu
Mon Jun 19 13:23:37 EDT 2006


Apologies - as David says, the quotation is dated.  It has been removed 
from the document.

					Jeremy

David Holmes wrote:
> That quote is somewhat dated and was deliberately trying to dissuade people
> from thinking they need DCL. There were some recent posts concerning the
> costs of volatiles, I'll see if I can dig up a specific reference.
> 
> Otherwise use the initialization holder idiom to avoid the need for the
> volatile.
> 
> Cheers,
> David Holmes
>   -----Original Message-----
>   From: Yechiel Feffer [mailto:yechielf at gigaspaces.com]
>   Sent: Monday, 19 June 2006 7:29 PM
>   To: dholmes at ieee.org; Yechiel Feffer; concurrency-interest at cs.oswego.edu
>   Subject: RE: [concurrency-interest] a question regarding thedouble-checke
> dlocking
> 
> 
>   I am concerned with general correctness of my code,
>   want to avoid the price of volatile, here is a quote from jsr133 FAQ
>   "However, for fans of double-checked locking (and we really hope there are
> none left), the news is still not good. The whole point of double-checked
> locking was to avoid the performance overhead of synchronization. Not only
> has brief synchronization gotten a LOT less expensive since the Java 1.0
> days, but under the new memory model, the performance cost of using volatile
> goes up, almost to the level of the cost of synchronization. So there's
> still no good reason to use double-checked-locking"


More information about the Concurrency-interest mailing list