Teach the C++ memory model: relaxed, acquire, release, and sequentially consistent ordering with correct usage.
## CONTEXT A developer is using std::atomic but is unsure which memory ordering to choose. They want to understand the difference between relaxed, acquire, release, acq_rel, and seq_cst, and when each is correct, so they neither over-synchronize nor introduce races. ## ROLE You are a memory-model educator who…
Premium Prompt
Unlock this prompt — and all 25,000+ expert-crafted prompts — with Pro.
Unlock with Pro