postgresql/src/backend
Andres Freund 450c7defa6 Remove volatiles from {procarray,volatile}.c and fix memory ordering issue.
The use of volatiles in procarray.c largely originated from the time
when postgres did not have reliable compiler and memory
barriers. That's not the case anymore, so we can do better.

Several of the functions in procarray.c can be bottlenecks, and
removal of volatile yields mildly better code.

The new state, with explicit memory barriers, is also more
correct. The previous use of volatile did not actually deliver
sufficient guarantees on weakly ordered machines, in particular the
logic in GetNewTransactionId() does not look safe.  It seems unlikely
to be a problem in practice, but worth fixing.

Thomas and I independently wrote a patch for this.

Reported-By: Andres Freund and Thomas Munro
Author: Andres Freund, with cherrypicked changes from a patch by Thomas Munro
Discussion:
    https://postgr.es/m/20181005172955.wyjb4fzcdzqtaxjq@alap3.anarazel.de
    https://postgr.es/m/CAEepm=1nff0x=7i3YQO16jLA2qw-F9O39YmUew4oq-xcBQBs0g@mail.gmail.com
2018-11-10 16:11:57 -08:00
..
access Remove volatiles from {procarray,volatile}.c and fix memory ordering issue. 2018-11-10 16:11:57 -08:00
bootstrap Install a check for mis-linking of src/port and src/common functions. 2018-09-09 12:23:23 -04:00
catalog Fix missing role dependencies for some schema and type ACLs. 2018-11-09 20:42:14 -05:00
commands Apply RI trigger skipping tests also for DELETE 2018-11-10 16:14:51 +01:00
executor Remove ineffective check against dropped columns from slot_getattr(). 2018-11-09 17:40:40 -08:00
foreign Correct constness of a few variables. 2018-10-15 21:01:14 -07:00
jit Fixup for b84a6dafbf triggering assert failure in LLVM debug builds. 2018-11-07 14:00:14 -08:00
lib Rename rbtree.c functions to use "rbt" prefix not "rb" prefix. 2018-11-06 13:25:24 -05:00
libpq Server-side fix for delayed NOTIFY and SIGTERM processing. 2018-10-19 21:39:21 -04:00
main Update copyright for 2018 2018-01-02 23:30:12 -05:00
nodes Revise attribute handling code on partition creation 2018-11-08 16:22:09 -03:00
optimizer Postpone calculating total_table_pages until after pruning/exclusion. 2018-11-07 12:12:56 -05:00
parser Revise attribute handling code on partition creation 2018-11-08 16:22:09 -03:00
partitioning Fix incorrect routine name reference in partprune.c 2018-11-08 20:14:16 +09:00
po Translation updates 2018-06-25 12:37:18 +02:00
port Fix spelling errors and typos in comments 2018-11-02 13:56:52 +01:00
postmaster Add pg_promote function 2018-10-25 09:46:00 +09:00
regex Clean up warnings from -Wimplicit-fallthrough. 2018-05-01 19:35:08 -04:00
replication Fix copy-paste error in errhint() introduced in 691d79a079. 2018-11-05 12:05:38 -08:00
rewrite Change rewriter/planner/executor/plancache to depend on RTE rellockmode. 2018-10-02 14:43:09 -04:00
snowball Sync our Snowball stemmer dictionaries with current upstream. 2018-09-24 17:29:38 -04:00
statistics Fix typos. 2018-08-27 09:32:59 +12:00
storage Remove volatiles from {procarray,volatile}.c and fix memory ordering issue. 2018-11-10 16:11:57 -08:00
tcop Server-side fix for delayed NOTIFY and SIGTERM processing. 2018-10-19 21:39:21 -04:00
tsearch Make ts_locale.c's character-type functions cope with UTF-16. 2018-11-03 13:56:10 -04:00
utils Apply RI trigger skipping tests also for DELETE 2018-11-10 16:14:51 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Refactor dlopen() support 2018-09-06 11:33:04 +02:00
nls.mk Translation updates 2018-06-25 12:37:18 +02:00