We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
IPC in PostgreSQL: Thomas Munro - PGCon 2023
Discover the ins and outs of IPC in PostgreSQL, including signal handling, latch functions, and best practices for async signal-safe handlers and Power management, from Thomas Munro at PGCon 2023.
-
Never-ending bugs ๐
-
IPC (Inter-Process Communication) issues in PostgreSQL: signal handling, incorrect usage can lead to bugs ๐ฃ
-
latch
is an unusual word in Postgres (origin from system R, originally meant for mutexes) ๐๏ธ -
Signals can be blocked or unblocked by various means (e.g.,
sigstop
,sigcont
,sigtstp
) โฐ -
Window signals: emulate signals on Windows (e.g.,
poll
,select
,k-event
,e-poll
) ๐ -
Real-time signals: not covered in this talk, but important for timely responses โฐ
-
Signal handlers must be async signal-safe ๐ฏ
-
Signal handlers should not be called from signal handlers ๐ซ
-
Postgres emulates signals on Windows to stabilize code (e.g.,
spinlocks
,latches
) โ๏ธ -
Power management: efficient use of resources, energy management โฏ๏ธ
-
Atomic operations: for updating flags in distributed systems ๐ฉ
-
Poll: superseded by
e-poll
andk-event
on modern systems โก๏ธ -
BPatches: bug fixes that directly target issues in signal handling โ ๏ธ