Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++the C++ memory modelSingle-choice MCQ

This is the IRIW (independent reads of independent writes) litmus test with acquire/release. Can the asserted outcome (r1==1, r2==0, r3==1, r4==0) occur?

// x, y atomic<int> = 0 // T1: x.store(1, release); // T2: y.store(1, release); // T3: r1 = x.load(acquire); r2 = y.load(acquire); // T4: r3 = y.load(acquire); r4 = x.load(acquire);