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: Fri, 25 Sep 2009 14:52:26 -0400
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 doesnât 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
>
>
>
> Iâd 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
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
>
>
>
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2400360
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy