PlanetJava
Custom Search

java-restlet-devel
[Top] [All Lists]

RE: Concurrency problem with the double check locking pattern

Subject: RE: Concurrency problem with the double check locking pattern
Date: Tue, 29 Sep 2009 15:04:56 +0200
Hi Tim,
Thanks for looking into this when you have a chance. But no worry during your 
vacation! :-)
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  <http://www.restlet.org/> 
http://www.restlet.org
Noelios Technologies ~ Co-founder ~  <http://www.noelios.com/> 
http://www.noelios.com
De : [email protected] 
[mailto:[email protected]] De la part de Tim 
Peierls
Envoyà : dimanche 27 septembre 2009 13:44
à : code-s0N/[email protected]
Objet : Re: Concurrency problem with the double check locking pattern
I'll take a close look at Template.java when I get back from vacation.
On Fri, Sep 25, 2009 at 2:52 PM, Tim Peierls 
<[email protected]> wrote:
What that paper says is that the double-checked locking idiom *as commonly 
applied* is broken. See a more recent description of the correct use of 
double-checked locking, including a discussion of when it is appropriate, in 
Effective Java, 2nd edition.
AFAIK, the Restlet codebase is doing things correctly, but I could have missed 
something. If you have a specific case that appears to be broken, let me know.
--tim
On Fri, Sep 25, 2009 at 6:30 AM, Jerome Louvel 
<[email protected]> wrote:
Hi guys,
Ivan Gorgiev came across a subtle multi-threading issue as described here:
Synchronization issues with Template
http://restlet.tigris.org/issues/show_bug.cgi?id=881
It appears that the double-check locking pattern that we use in many places in 
Restlet code doesnt work reliably in some environments (AMD-64 in his case).
He further points to this web page which worries me:
The "Double-Checked Locking is Broken" Declaration
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
Id like to get the opinion of concurrency experts in this list to see if we 
better synchronize all those lazy creation methods instead?
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  <http://www.restlet.org/> 
http://www.restlet.org
Noelios Technologies ~ Co-founder~  <http://www.noelios.com/> 
http://www.noelios.com
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2401610
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy