diff options
| author | Andres Freund <andres@anarazel.de> | 2015-01-13 12:58:43 +0100 |
|---|---|---|
| committer | Andres Freund <andres@anarazel.de> | 2015-01-13 12:58:43 +0100 |
| commit | 14e8803f101a54d99600683543b0f893a2e3f529 (patch) | |
| tree | 49ebc68f04f7905c2365d335c6e945339f4f9d51 /src/include/storage | |
| parent | 4bad60e3fd9a5fc6070fd4d1bd820a280e174654 (diff) | |
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
Diffstat (limited to 'src/include/storage')
| -rw-r--r-- | src/include/storage/latch.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/include/storage/latch.h b/src/include/storage/latch.h index 138a748f624..f1577b00955 100644 --- a/src/include/storage/latch.h +++ b/src/include/storage/latch.h @@ -57,13 +57,6 @@ * SetLatch *after* that. SetLatch is designed to return quickly if the * latch is already set. * - * Presently, when using a shared latch for interprocess signalling, the - * flag variable(s) set by senders and inspected by the wait loop must - * be protected by spinlocks or LWLocks, else it is possible to miss events - * on machines with weak memory ordering (such as PPC). This restriction - * will be lifted in future by inserting suitable memory barriers into - * SetLatch and ResetLatch. - * * On some platforms, signals will not interrupt the latch wait primitive * by themselves. Therefore, it is critical that any signal handler that * is meant to terminate a WaitLatch wait calls SetLatch. |
