[cpp-threads] Visibility question

Nelson, Clark clark.nelson at intel.com
Wed Aug 2 00:05:08 BST 2006


> In the current draft proposals, there would be a synchronizes-with (or
> communicates-with) relationship introduced by both load-store pairs.
> Hence there would be no race.  The ordered fetch_adds and the raw
> operations conspire to introduce a happens-before edge.
> 
> In the alternative formulation, the raw operations do not introduce a
> synchronizes-with relationship, which means there are no 
> happens-before
> edges between threads, and there is a race.
> 
> My intuition is that the current formulation is right.  Opinions?

So the essence of the question seems to be, can threads 1 and 2
synchronize using different atomic variables, even by using ordered
stores? Not that I actually think my opinion is worth much in this area,
but I'm not too concerned if the answer is that the standard doesn't
guarantee that they can. But it wouldn't surprise me at all if it worked
anyway, on an awful lot of implementations.

Clark



More information about the cpp-threads mailing list