[cpp-threads] Yet another visibility question

Peter Dimov pdimov at mmltd.net
Sun Oct 8 20:36:23 BST 2006


Hans Boehm wrote:

> In the current proposal (N2052), the assert is not guaranteed to
> succeed, except in the fetch_add_ordered case.  A synchronizes with,
> and hence happens before, B only of B is an acqire operation that
> reads the value written by release operation A.
>
> If you used r1 = load_acquire(y) in thread 2, the assert would always
> succeed.
>
> I'm OK with that behavior.

Thanks. So if my understanding is correct,

- an "ordered" RMW operation can be specified as the read part having 
acquire semantics and the write part having release semantics;

- reference count decrements for mutable objects need to be "ordered" in 
order to transitively propagate the writes to the object to the thread 
performing the last decrement and invoking the destructor.

We've been assuming so far that fetchadd_release is OK until the final 
decrement, and this doesn't seem to be the case. 




More information about the cpp-threads mailing list