[cpp-threads] Memorymodelcounterproposal:synchronizationoperations

Peter Dimov pdimov at mmltd.net
Fri May 27 21:32:47 BST 2005


Boehm, Hans wrote:
> As Alexander implies, and is pointed out in
>
> http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
>
> this only works if the object being lazily initialized is static.
> If you want to lazily initialize a field of a particular kind of
> object, of which there may be many, you need a different mechanism.

If you give me an example of the DCL original and the __async volatile 
replacement, I will gladly supply the idiomatic equivalent.

The other half of the argument is the #StoreLoad in front of if( p == 0 ) 
when p is __async volatile. I know that with some hand-waving and squinting 
just right we can make it disappear. ;-) 





More information about the cpp-threads mailing list