aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execParallel.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2020-06-15 18:23:10 -0700
committerAndres Freund <andres@anarazel.de>2020-06-17 12:41:45 -0700
commitfd49d53807575e009f7b66771d48c9356344d7d1 (patch)
treeaedd8e0a1a18da535dd800ba80b889e8fa695bb0 /src/backend/executor/execParallel.c
parent2fd2effc50824a8775a088435a13f47b7a6f3b94 (diff)
downloadpostgresql-fd49d53807575e009f7b66771d48c9356344d7d1.tar.gz
postgresql-fd49d53807575e009f7b66771d48c9356344d7d1.zip
Avoid potential spinlock in a signal handler as part of global barriers.
On platforms without support for 64bit atomic operations where we also cannot rely on 64bit reads to have single copy atomicity, such atomics are implemented using a spinlock based fallback. That means it's not safe to even read such atomics from within a signal handler (since the signal handler might run when the spinlock already is held). To avoid this issue defer global barrier processing out of the signal handler. Instead of checking local / shared barrier generation to determine whether to set ProcSignalBarrierPending, introduce PROCSIGNAL_BARRIER and always set ProcSignalBarrierPending when receiving such a signal. Additionally avoid redundant work in ProcessProcSignalBarrier if ProcSignalBarrierPending is unnecessarily. Also do a small amount of other polishing. Author: Andres Freund Reviewed-By: Robert Haas Discussion: https://postgr.es/m/20200609193723.eu5ilsjxwdpyxhgz@alap3.anarazel.de Backpatch: 13-, where the code was introduced.
Diffstat (limited to 'src/backend/executor/execParallel.c')
0 files changed, 0 insertions, 0 deletions