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

* Re: PPC atomic.h and compare_exchange_val forms
  2003-04-15 19:32 PPC atomic.h and compare_exchange_val forms Steven Munroe
@ 2003-04-15 19:41 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2003-04-15 19:41 UTC (permalink / raw)
  To: sjmunroe; +Cc: libc-hacker, Paul Mackerras

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steven Munroe wrote:

> I recommend dropping any mention of the 8- and 16-bit forms from
> include/atomic.h.

The definitions can be used in machine-specific files.  Therefore
they'll not be dropped.  You don't have to implement them for every
architecture, it might just mean different sources are going to be used.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+nGBT2ijCOnn/RHQRAtmRAJ9VtaRIF4V8e75yZu9xhdsvixbfgwCfST56
ABxRO36DEgM7l3TBeXrgORg=
=g3rg
-----END PGP SIGNATURE-----

^ 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).