This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] atomics
Hi Peter!
> I think that you don't need to pass the constraint to
> __atomic_wait_explicit (and to the corresponding clear).
I think you mean
void
__atomic_flag_wait_explicit(volatile atomic_flag* a, memory_order x)
{ while (atomic_flag_test_and_set_explicit(a, x)) { }; }
Right?
In the originating paper, there was a non-constrained
__atomic_flag_wait
but it was not used anywhere in the code, so I took it out.
Clarification from Lawrence as to intent here would be appreciated.
Anyway.
> A lock-based
> implementation with a lock() with acquire semantics and an unlock()
> with release semantics (which __sync_lock_test_and_set and
> __sync_lock_release already provide) already implements the seq_cst
> constraint.
I thought the only difference was seq_cst has sequentially-consistent
operation ordering. (Which is more than just acquire/release alone
guarantee.)
?
Perhaps if you modify the List Insert example in N2427 to show what you
are getting at it will be clearer to me.
best,
-benjamin