[PATCH] Add atomic operations required by the new condition variable.

Florian Weimer fweimer@redhat.com
Fri May 27 09:57:00 GMT 2016


On 05/26/2016 01:04 AM, Torvald Riegel wrote:
> +# ifndef atomic_exchange_relaxed
> +/* XXX This unnecessarily has acquire MO.  */

I don't understand the use of the XXX marker here.  If there is a 
potential bug, this needs a longer explanation.  If this is just use of 
an unnecessarily strong memory order, a generic remark somewhere in the 
file that “architectures might override the following defines with 
relaxed MO implementation for improved performance” or something like 
that should address this, and that doesn't warrant an XXX marker.

(Ideally, our atomics and how to implement them should be documented in 
internals manual, or we should use GCC atomics directly so that we don't 
need our own documentation.  But that's an old and separate discussion. 
Using the GCC syntax would also avoid the unfortunate naming pattern, 
e.g. “atomic_fetch_or_release”.)

Apart from the XXX bits, the changes look okay to me.

Florian



More information about the Libc-alpha mailing list