To be sure the compiler won’t be the one to reorder our operations, we’ll use the std::sync::compiler_fence() function to inform the compiler of the operations that should have been Acquire or Release, without telling the processor.
Description of the error
The compiler_fence() function seems to be in the std::sync::atomic module, not std::sync module.
Type of error
Minor technical mistake
Location of the error
https://marabos.nl/atomics/hardware.html#reordering-experiment
Description of the error
The
compiler_fence()
function seems to be in thestd::sync::atomic
module, notstd::sync
module.https://doc.rust-lang.org/std/sync/atomic/fn.compiler_fence.html