Heikki Linnakangas wrote:
> An even better approach would be to have a configure test for
> __sync_lock_test_and_set. A quick google search suggests that Intel
> C Compiler version >= 11.0 also supports __sync_lock_test_and_set,
> for example.
explicitly refers to intel CC as well.
> 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.
Note that a simple AC_CHECK_FUNC(__sync_lock_test_and_set) does not
work, so I used a slightly more complicated AC_TRY_LINK() which also
verifies that __sync_lock_release() is available.
The patch is against 9.1.2, but I suppose it also applies to trunk
(except perhaps the autogenerated configure part, this needs an
Thanks for considering,
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: Alex Hunsaker||Date: 2011-12-19 00:35:54|
|Subject: Re: BUG #6344: Trouble with plperl|
|Previous:||From: Michael Meskes||Date: 2011-12-18 18:05:57|
|Subject: Re: BUG #6343: PGTYPES library missing qualifiers|