Investigating Multithreaded PostgreSQL
summary
Postgres still uses a 1980s process-per-connection design and this work evaluates replacing that with threads by testing prototypes: a pg_threads.h shim, converting atomics to C11, and experiments with Heikki's branch that runs queries but crashes on heavier workloads. Async I/O patches land in Postgres 18 beta and expose cross-process completion issues. Windows fork emulation costs roughly 40 ms on a trivial parallel worker. Proposals include replacing signals with latch-driven interrupts.
AI-written summary · about
chapters (15)
- 0:00Introduction and background
- 2:14Operating system process models
- 5:10Understanding fork mechanics
- 11:04Porting to Windows
- 13:14Subprocess execution
- 16:51Thread creation and C11
- 19:14Atomic operations
- 20:49Motivations for multithreading
- 23:26Asynchronous IO issues
- 27:14Database architectural designs
- 31:00Green threads and future goals
- 33:33Managing global state
- 37:07Postmaster and supervisor roles
- 38:27Work in progress and goals
- 43:58Signal removal and conclusion








