[cpp-threads] memory model

Doug Lea dl at cs.oswego.edu
Fri Apr 29 13:53:16 BST 2005


> On an unrelated note, I wonder what the semantics of x = y are supposed to 
> be under the new volatile when x and y are volatile variables of a struct 
> type that contains two or more pointers (this code is valid today, so it 
> can't be made a compile-time error.) 
> 
> 


Right. This is why "volatile" is not the same as "atomic".
You always get barriers, but loads/stores of only those
volatile variables smaller than some platform-dependent size are also
atomic.

-Doug





More information about the cpp-threads mailing list