Skip site navigation (1) Skip section navigation (2)

pgsql: Use __sync_lock_test_and_set() for spinlocks on ARM,if availabl

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Use __sync_lock_test_and_set() for spinlocks on ARM,if availabl
Date: 2012-01-07 20:40:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Use __sync_lock_test_and_set() for spinlocks on ARM, if available.

Historically we've used the SWPB instruction for TAS() on ARM, but this
is deprecated and not available on ARMv6 and later.  Instead, make use
of a GCC builtin if available.  We'll still fall back to SWPB if not,
so as not to break existing ports using older GCC versions.

Eventually we might want to try using __sync_lock_test_and_set() on some
other architectures too, but for now that seems to present only risk and
not reward.

Back-patch to all supported versions, since people might want to use any
of them on more recent ARM chips.

Martin Pitt



Modified Files
configure                    |   61 ++++++++++++++++++++++++++++++++++++++++++                 |   11 +++++++
src/include/   |    3 ++
src/include/storage/s_lock.h |   25 ++++++++++++++++-
4 files changed, 98 insertions(+), 2 deletions(-)

pgsql-committers by date

Next:From: Peter EisentrautDate: 2012-01-07 21:21:46
Subject: pgsql: Rename the internal structures of the CREATE TABLE (LIKE ...)fa
Previous:From: Robert HaasDate: 2012-01-07 03:59:02
Subject: pgsql: Slightly reorganize struct SnapshotData.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group