Struct with default ctor (Was: [dmd-beta] dmd 2.064 beta take 2)

Walter Bright newshound2 at digitalmars.com
Sun May 19 14:11:51 PDT 2013


On 5/19/2013 2:02 PM, Walter Bright wrote:
> If you have a global value accessible from multiple threads, you must use
> synchronization. There is no way around that. If you use some other global state
> to check for initialization in order to avoid synchronization, you have the
> double checked locking bug. Yes, you do.


BTW, a few years ago, I presented my clever solution to the double checked 
locking bug to Scott Meyers. I was very proud of it. Scott handed me my @ss (in 
a nice way), but I got my comeuppance.

It reminded me of the hours I spent in high school determined to show that I 
could trisect an angle with a compass and a straightedge. There was always some 
tiny flaw :-)



More information about the Digitalmars-d mailing list