This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Purpose of USE_ATOMIC_COMPILER_BUILTINS


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]