Re: Better LWLocks with compare-and-swap (9.4) - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Better LWLocks with compare-and-swap (9.4)
Date
Msg-id CAHyXU0x+oYbf1=wYX_=DdsgmmDdQ9yQTm2A469DZRJqs1u-BvQ@mail.gmail.com
Whole thread Raw
In response to Better LWLocks with compare-and-swap (9.4)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Better LWLocks with compare-and-swap (9.4)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
On Mon, May 13, 2013 at 7:50 AM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:
> The attached patch is still work-in-progress. There needs to be a configure
> test and fallback to spinlock if a CAS instruction is not available. I used
> the gcc __sync_val_compare_and_swap() builtin directly, that needs to be
> abstracted. Also, in the case that the wait queue needs to be manipulated,
> the code spins on the CAS instruction, but there is no delay mechanism like
> there is on a regular spinlock; that needs to be added in somehow.

These are really interesting results. Why is the CAS method so much
faster then TAS?  Did you see any contention?

merlin



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Add more regression tests for dbcommands
Next
From: Merlin Moncure
Date:
Subject: Re: lock support for aarch64