Multiple ChoiceBeginner 45s
memory_order_relaxed visibility
A thread runs a.store(1,relaxed); b.store(1,relaxed). Another thread observes b.load(relaxed)==1 then reads a. Which is guaranteed?
Options
- 1The reader is guaranteed to observe a==1
- 2The stores and loads are sequentially consistent
- 3No ordering is guaranteed; the reader may observe a==0
- 4The program has undefined behavior
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.