> In case you didn't know: The double-checked locking pattern originally
> proposed by Douglas C. Schmidt is proven inherently unsafe in Java.
> 
> See 
> http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html.

I've heard about this one, thanks for bringing it up. This probably isn't
the right forum to be debating how to do thread safe code so I won't bang
on about it, but the web page does note that double-checked locking works
for 32-bit primitives -- I'm not sure if the boolean used in the previous
discussion counts as a 32-bit primitive (I hope so, since int and float do).

Cheers,
Mike.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to