This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Purpose of USE_ATOMIC_COMPILER_BUILTINS
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 16 Nov 2015 16:37:22 +0100
- Subject: Purpose of USE_ATOMIC_COMPILER_BUILTINS
- Authentication-results: sourceware.org; auth=none
What is the USE_ATOMIC_COMPILER_BUILTINS? Is it still needed now that
we require GCC 4.7 or later to compile glibc?
I'm asking because the provided set of macros is fairly incomplete
(there is fetch_add, but not sub_fetch), and there are some rather
questionable mappings, for example:
atomic_increment â atomic_add â atomic_exchange_and_add â
atomic_exchange_and_add_acq
This suggests that atomic_increment only provides acquire memory
ordering, which is quite surprising.
I'm dealing with a few data races and deadlocks in malloc right now, and
it would be nice to use the right atomics to solve them. But based on
the contents of the <atomic.h> header, I'm not sure if this is possible.
Florian