PostgreSQL explains memory barriers for atomic ordering on ARM

jnidzwetzki.github.io38 min read

PostgreSQL uses memory and compiler barriers, volatile variables, and atomic operations to prevent compilers and CPUs from reordering memory accesses in ways that break process synchronization. Because PostgreSQL relies on a process-based architecture with shared memory on multi-processor systems, operations can appear out of order on weakly-ordered architectures like ARM. While x86 requires only compiler barriers for basic synchronization due to its strong memory model, ARM platforms require hardware memory barriers to ensure safe inter-process communication. Open article →