public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* PPC atomic.h and compare_exchange_val forms
@ 2003-04-15 19:32 Steven Munroe
  2003-04-15 19:41 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Munroe @ 2003-04-15 19:32 UTC (permalink / raw)
  To: libc-hacker, Paul Mackerras

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-15 19:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-15 19:32 PPC atomic.h and compare_exchange_val forms Steven Munroe
2003-04-15 19:41 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).