m-ou-se / rust-atomics-and-locks

Code examples, data structures, and links from my book, Rust Atomics and Locks.
Other
1.33k stars 120 forks source link

Chapter 7 wrong module name? #40

Closed kdnakt closed 1 year ago

kdnakt commented 1 year ago

Type of error

Minor technical mistake

Location of the error

https://marabos.nl/atomics/hardware.html#reordering-experiment

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.

https://doc.rust-lang.org/std/sync/atomic/fn.compiler_fence.html

m-ou-se commented 1 year ago

Thanks! Fixed!