[cpp-threads] Yet another visibility question

Alexander Terekhov alexander.terekhov at gmail.com
Mon Oct 9 09:42:58 BST 2006


On 10/8/06, Peter Dimov <pdimov at mmltd.net> wrote:
> 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 don't see how that changes anything regarding visibility of x.

> >
> > 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.

I don't think so.

regards,
alexander.



More information about the cpp-threads mailing list