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]

Re: [PATCH v2] Add and use new glibc-internal futex API.


On Wed, 17 Jun 2015, Roland McGrath wrote:

> > Interacting with futex words requires atomic accesses, which isn't done
> > by most of glibc's current futex callers. [...]
> 
> I certainly concur with leaving this until later.  What I think will be
> reasonable to do eventually is to use the <stdatomic.h> type names in
> all our internal interfaces (probably only atomic_int or atomic_uint
> should be used for futex stuff).  When building with older compilers
> that don't have those, our own internal headers can typedef the ones
> we use to the simple types (or perhaps volatile-qualified ones?).

Those types imply seq_cst memory order for plain loads and stores, which 
isn't what's wanted in most places in glibc (one might expect many places 
presently using plain loads and stores actually want relaxed memory 
order).  Operations on _Atomic types may also bring in libatomic 
dependencies depending on processor support, causing obvious problems with 
circular dependencies (libatomic depends on libpthread).

-- 
Joseph S. Myers
joseph@codesourcery.com


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