Why Multi-Threaded Code Can Sometimes Misbehave (Weak Memory Concurrency) - Computerphile
Computerphile
May 18, 2026
Modern hardware and compilers prioritize performance over intuitive execution, leading to 'weak memory' behaviors where instructions are reordered or delayed in store buffers. While high-level abstractions hide these complexities, developers working in low-level languages like C++ or Rust must account for non-deterministic outcomes that defy traditional sequential consistency models.
Key insight: Even on modern hardware, it is possible for two threads to both read initial zero values from shared memory locations despite having already executed write instructions, because hardware store buffers delay visibility to other cores.