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: installing the <atomic.h> header?


  Hi!

On Thu, Nov 04, 2010 at 03:25:47PM -0400, Chris Metcalf wrote:
> Glibc uses <atomic.h> (with <bits/atomic.h>) internally but does not
> install it.  The header would seem to be a great way to provide convenience
> wrappers to atomic functionality.  On our platforms (TILEPro, TILE-Gx) the
> atomic operations are a mix of builtins, compare-exchange loops, and fast
> kernel calls that no user would want to have to re-invent just to get
> access to proper atomic instructions.  There used to be folks who used
> <asm/atomic.h> from userspace for this kind of thing, but of course that no
> longer works, as the kernel no longer exports that header.

  IMHO most of this stuff is not really a kernel service or worth a
library routine, but just making use of your instruction set properly.
So a compiler matter, solved not too badly with

	http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Atomic-Builtins.html

  I don't think the extra layer of <atomic.h> convenience routines is
all that significant; and no kernel calls are wrapped by this, AFAICS.

-- 
				Petr "Pasky" Baudis
The true meaning of life is to plant a tree under whose shade
you will never sit.


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