[cpp-threads] Re: A hopefully clearer document on POSIX threads

Doug Lea dl at cs.oswego.edu
Sun Feb 19 23:38:33 GMT 2006


Herb Sutter wrote:
> 
> But what about the causality example raised some months ago here? In
> particular:
> 
>   initial: x = y = 0;
> 
>   P0: x = 1;
> 
>   P1: if( x == 1 ) y = 1;
> 
>   P2: if( y == 1 ) assert ( x == 1 ); // can P2 see y==1 before x==1?
> 

When I asked, people from Intel and AMD told me that this does have the desired
effect now, but don't promise it in the future. As I said the first time around,
this is not a big deal in practice, but makes the specs much messier.
For Java, we'll probably have to revisit this when non-conforming processors
arise, if they ever do. For C++, I suppose it is a good idea to assume
lack of transitivity to begin with.

-Doug




More information about the cpp-threads mailing list