Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC++relaxed memory semanticsSingle-choice MCQ

With both flags atomic and ALL operations using memory_order_relaxed (initial values 0), is the outcome r1 == 0 && r2 == 0 possible?

// x, y atomic<int> = 0 // T1: x.store(1, relaxed); r1 = y.load(relaxed); // T2: y.store(1, relaxed); r2 = x.load(relaxed);