Re: Better LWLocks with compare-and-swap (9.4)

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Better LWLocks with compare-and-swap (9.4)
Date: 2013-05-20 20:20:50
Message-ID: 519A85A2.5040704@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20.05.2013 23:11, Alvaro Herrera wrote:
>> diff --git a/configure.in b/configure.in
>> index 4ea5699..ff8470e 100644
>> --- a/configure.in
>> +++ b/configure.in
>> @@ -1445,17 +1445,6 @@ fi
>> AC_CHECK_FUNCS([strtoll strtoq], [break])
>> AC_CHECK_FUNCS([strtoull strtouq], [break])
>>
>> -AC_CACHE_CHECK([for builtin locking functions], pgac_cv_gcc_int_atomics,
>> -[AC_TRY_LINK([],
>> - [int lock = 0;
>> - __sync_lock_test_and_set(&lock, 1);
>> - __sync_lock_release(&lock);],
>> - [pgac_cv_gcc_int_atomics="yes"],
>> - [pgac_cv_gcc_int_atomics="no"])])
>> -if test x"$pgac_cv_gcc_int_atomics" = x"yes"; then
>> - AC_DEFINE(HAVE_GCC_INT_ATOMICS, 1, [Define to 1 if you have __sync_lock_test_and_set(int *) and friends.])
>> -fi
>> -
>
> Careful here --- s_lock.h has some code conditional on
> HAVE_GCC_INT_ATOMICS which your patch is not touching, yet it is
> removing the definition, unless I'm misreading.

Thanks, good catch. I renamed HAVE_GCC_INT_ATOMICS to
HAVE_GCC_INT_TEST_AND_SET because "atomics" seems too generic when we
also test for __sync_val_compare_and_swap(p, oldval, newval).

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2013-05-20 20:41:07 Re: Better LWLocks with compare-and-swap (9.4)
Previous Message Heikki Linnakangas 2013-05-20 20:16:41 Re: Better LWLocks with compare-and-swap (9.4)