pgsql: Add barriers to the latch code. - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: Add barriers to the latch code.
Date
Msg-id E1YB0Jl-00081h-Ch@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Add barriers to the latch code.

Since their introduction latches have required barriers in SetLatch
and ResetLatch - but when they were introduced there wasn't any
barrier abstraction. Instead latches were documented to rely on the
callsites to provide barrier semantics.

Now that the barrier support looks halfway complete, add the necessary
barriers to both latch implementations.

Also remove a now superflous lock acquisition from syncrep.c and a
superflous (and insufficient) barrier from freelist.c. There might be
other cases that can now be simplified, but those are the only ones
I've seen on a quick scan.

We might want to backpatch this at some later point, but right now the
barrier infrastructure in the backbranches isn't totally on par with
master.

Discussion: 20150112154026.GB2092@awork2.anarazel.de

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/14e8803f101a54d99600683543b0f893a2e3f529

Modified Files
--------------
src/backend/port/unix_latch.c         |   16 +++++++---------
src/backend/port/win32_latch.c        |   16 ++++++++++++++++
src/backend/replication/syncrep.c     |   10 ----------
src/backend/storage/buffer/freelist.c |    1 -
src/include/storage/latch.h           |    7 -------
5 files changed, 23 insertions(+), 27 deletions(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: Allow latches to wait for socket writability without waiting for
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Silence Coverity warnings about unused return values from pushJs