This is the mail archive of the
libc-hacker@sources.redhat.com
mailing list for the glibc project.
Note that libc-hacker is a closed list. You may look at
the archives of this list, but subscription and posting are not open.
PPC atomic.h and compare_exchange_val forms
- From: Steven Munroe <sjmunroe at us dot ibm dot com>
- To: libc-hacker at sources dot redhat dot com, Paul Mackerras <paulus at samba dot org>
- Date: Tue, 15 Apr 2003 14:32:32 -0500
- Subject: PPC atomic.h and compare_exchange_val forms
- Reply-to: sjmunroe at vnet dot ibm dot com
I sent the patch to libc-alpha to fix the current problem for PPC64 but
I think there is a larger issue that needs to be discussed.
For the macros defined by include/atomic.h, which forms are included for
the convenience of specific architecture and which forms are part of the
common API (i.e. can they be freely used in arch independent parts of
glibc)?
For example atomic_compare_and_exchange_val_acq. Are all forms (8-, 16-,
32-, and 64-bit) of this operation expected to be available for general
use?
A quick review of arch specific atomic.h's shows that only i386 and m68k
support the 8- and 16-bit forms. Most arch's define these to abort().
The 64-bit form is also problematic on most 32-bit arches.
For PPC32/PPC64 implementing the 8- and 16-bit forms would be
problematic. The resulting code would be slow and prone to live lock
conditions. I assume that this is true for most architectures.
I recommend dropping any mention of the 8- and 16-bit forms from
include/atomic.h.