Memory Model Purpose Guide agents through C++ and Rust memory models: memory orderings, the happens-before relation, atomic operations, fences, and practical patterns for lock-free data structures. Triggers - "What is the C++ memory model?" - "What memory order should I use for my atomic operation?" - "What is the difference between acquire-release and seq cst?" - "How do I use std::atomic in C++?" - "What is acquire/release in Rust atomics?" - "How do I implement a lock-free queue?" Workflow 1. Memory ordering overview Modern CPUs and compilers reorder operations for performance. The memory…