Is Release
memory order in Arc::make_mut
only necessary to prevent out-of-thin-air value?
#61
Labels
Release
memory order in Arc::make_mut
only necessary to prevent out-of-thin-air value?
#61
The content that the question is about
https://marabos.nl/atomics/building-arc.html#optimizing-arc
The question
The
Release
memory order at#1
presumably prevent data-race in this exampleAssuming
#1
uses theRelaxed
memory order, and this example can be equivalently simplified to#4
is executed only if#3
reads#2
, and#2
is executed only if#1
reads#4
, a dependency chain. The C++ standard, https://eel.is/c++draft/atomics.order#8 explicitly disallow OOTASo, is the
Release
memory order inmake_mut
preventing OOTA?The text was updated successfully, but these errors were encountered: