Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++atomics and memory orderingSingle-choice MCQ

What outcome does the Dekker-style 'store-buffer' litmus test below allow on x86, and why, despite x86 being a strongly-ordered (TSO) architecture?

// x, y atomic<int> = 0, using seq_cst would forbid this // T1: x.store(1, relaxed); r1 = y.load(relaxed); // T2: y.store(1, relaxed); r2 = x.load(relaxed); // Can r1 == 0 && r2 == 0 ?