File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 57
57
//! as the final optimized code, when executed, produces the same results as the one
58
58
//! without optimizations.
59
59
//!
60
- //! When multiprocessing is involved (either multiple CPU cores, or multiple
61
- //! physical CPUs), access to global variables (which are shared between threads)
62
- //! could lead to nondeterministic results, **even if** compiler optimizations
63
- //! are disabled.
60
+ //! Due to the [concurrency] involved in modern computers, assumptions about
61
+ //! the program's execution order are often wrong. Access to global variables
62
+ //! can lead to nondeterministic results, **even if** compiler optimizations
63
+ //! are disabled, and it is **still possible** to introduce synchronization bugs .
64
64
//!
65
65
//! Note that thanks to Rust's safety guarantees, accessing global (static)
66
66
//! variables requires `unsafe` code, assuming we don't use any of the
67
67
//! synchronization primitives in this module.
68
68
//!
69
69
//! [constant folding]: https://en.wikipedia.org/wiki/Constant_folding
70
+ //! [concurrency]: https://en.wikipedia.org/wiki/Concurrency_(computer_science)
70
71
//!
71
72
//! ## Out-of-order execution
72
73
//!
You can’t perform that action at this time.
0 commit comments