Robert Haas [2011-12-19 9:31 -0500]:
> On Sun, Dec 18, 2011 at 5:42 PM, Martin Pitt <mpitt(at)debian(dot)org> wrote:
> >> It probably makes sense to use it on any platform where it's
> >> defined. Presumably an implementation provided by the compiler is
> >> always going to be at least as good as any magic assembler
> >> incantations we can come up with.
> > I agree. How about a patch like this? It uses builtin atomics if
> > available, and falls back to the custom implementations if not.
> -1. Absent some evidence that gcc's implementations are superior to
> ours, I think we should not change stuff that works now. That's
> likely to lead to subtle bugs that are hard to find and perhaps
> dependent on the exact compiler version used.
> But I'm completely cool with doing this for platforms where we haven't
> otherwise got an implementation. Any port in a storm.
Sure, then the other option is to stuff this at the end of s_lock.h if
we don't already have HAS_TEST_AND_SET. This would then mean that we
need to remove the armel implementation, as it doesn't really work on
anything non-ancient, and the gcc one got some fairly good test
coverage by now.
I'm happy to work out the patch for this. I'll just wait a bit if
there are more comments on this.
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
In response to
pgsql-bugs by date
|Next:||From: Martin Pitt||Date: 2011-12-19 15:39:43|
|Subject: Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS
patch for building on armel/armhf thumb]|
|Previous:||From: Tom Lane||Date: 2011-12-19 15:25:12|
|Subject: Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb] |