This is the mail archive of the
mailing list for the glibc project.
Re: gcc 4.1 implements compiler builtins for atomic ops
On Sun, 2005-06-26 at 16:38 -0700, Ulrich Drepper wrote:
> Benjamin Herrenschmidt wrote:
> > Yes, but that encourage developers to use them direcltly, which means
> > that they'll, for example, produce code that will either be broken for
> > 405 or will have a spurrious sync on non-405 which is a significant
> > performance issue.
> So what? This is an issue for binaries. How many binaries are shared
> between reasonable implementations and the broken ones? Don't generate
> the sync op by default and tell the losers who use the broken processors
> to throw them out or build their own binaries. You can even invent a
> mechanism to check for binaries compiled this way.
> And go, beat up the processor people. They cause the problems. We
> cannot have everybody else suffer from that. We have the APIs for all
> kinds of processors and every arch which needs to be treated special
> will fall aside since the extra handling is not acceptable to most
Which is exactly why I don't want these to be in the compiler. A library
would be just fine. In fact, I wanted to expose that from the vDSO once
we have sorted out how glibc uses vDSO functions on non-vsyscall setups
like ppc, so the kernel can just expose the right implementation for a