[cpp-threads] memory model

Hans Boehm Hans.Boehm at hp.com
Thu May 5 17:26:05 BST 2005


The intent is yes in all cases.  It is currently an open problem how to
state that in the current memory model.  But I don't think anyone has
thought about it for very long, yet.

Hans

On Thu, 5 May 2005, Peter Dimov wrote:

> I have the following question about the proposed memory model:
>
> In the examples below:
>
> 1.
>
>     r1 = atomic_load( &x );
>     r2 = y;
>
> 2.
>
>     r1 = atomic_load( &x );
>     r2 = atomic_load( &y );
>
> 3.
>
>     if( r1 = atomic_load( &x ) )
>         r2 = y;
>
> (note that the atomic loads do not have an associated ordering constraint)
>
> is the compiler or the hardware allowed to reorder the two loads?
>
> --
> cpp-threads mailing list
> cpp-threads at decadentplace.org.uk
> http://decadentplace.org.uk/mailman/listinfo/cpp-threads_decadentplace.org.uk
>




More information about the cpp-threads mailing list