On 06 June 2012 21:20:02 +0200 Howard Lewis Ship <[email protected]> wrote:
http://tapestryjava.blogspot.com/2012/06/synchronized-considered-harmful.html
I am curious is there a reason to not use 'double-checked locking' pattern? I 
know that it was broken in Java 1.4 and earlier, but Java Memory Model was 
changed (JSR-133) for Java 5.0 to accommodate that pattern. Of course, you need 
to use 'volatile' field, but AFAIK it does not impose any significant penalty 
(especially for reads) on most platforms including most x86 and emt64. Am I 
missing something?

Cezary



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to