Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb]
От | Martin Pitt |
---|---|
Тема | Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb] |
Дата | |
Msg-id | 20111219152702.GI2972@piware.de обсуждение исходный текст |
Ответ на | Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb] (Robert Haas <robertmhaas@gmail.com>) |
Список | pgsql-bugs |
Robert Haas [2011-12-19 9:31 -0500]: > On Sun, Dec 18, 2011 at 5:42 PM, Martin Pitt <mpitt@debian.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. Thanks, Martin -- Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
В списке pgsql-bugs по дате отправления: