
Memory Model
This one walks you through C++ and Rust memory models when you're writing lock-free code or trying to pick the right ordering for atomic operations. It covers the spectrum from relaxed to seq_cst, explains acquire-release semantics with concrete examples, and includes practical patterns like spinlocks and reference counting. The ordering decision tree is useful: it tells you when relaxed is enough versus when you need stronger guarantees. If you've ever stared at std::atomic documentation wondering whether you need acquire or release, or debugged a race that only shows up under load, this gives you the mental model to reason about it. The common mistakes section alone will save you from the volatile trap.
- skills.sh installs
- 693
- GitHub stars
- 279
- last updated
- Aug 21, 2026
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill memory-model --agent claude-codeInstalls into .claude/skills of the current project.
Files
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 model specifies what reorderings are allowed and how synchronisation is achieved.
Ordering strength (weakest to strongest):
Relaxed < Release/Acquire < AcqRel < SeqCst
Stronger ordering = more synchronization = more correct, but slower
Weaker ordering = fewer barriers = faster, but needs careful analysis
2. Memory orderings
Sponsors
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- Categories
- Documentation, Release Management, Rust
- First seen
- Jun 3, 2026
More from mohitmishra786/low-level-dev-skills
All 54- Freertos691
- Linux Kernel Modules689
- Ninja681
- Heaptrack676
- Rust Profiling673
- Ebpf672
- Msvc Cl671
- Fuzzing670
- Binutils665
- Linkers Lto663
- Conan Vcpkg659
- Dynamic Linking650
- Rust Security624
- Rust Ffi613
- Rust Unsafe611
- Pgo610
- Interpreters609
- Cargo Workflows608
- Rust Sanitizers Miri604
- Meson603
- Cpp Modules597
- Rust Debugging597
- Hardware Counters590
- Debug Optimized Builds579