Skip to content

Commit 7e921aa

Browse files
committed
Rewrite section on concurrency
1 parent bcec6bb commit 7e921aa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/libstd/sync/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,17 @@
5757
//! as the final optimized code, when executed, produces the same results as the one
5858
//! without optimizations.
5959
//!
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.
6464
//!
6565
//! Note that thanks to Rust's safety guarantees, accessing global (static)
6666
//! variables requires `unsafe` code, assuming we don't use any of the
6767
//! synchronization primitives in this module.
6868
//!
6969
//! [constant folding]: https://en.wikipedia.org/wiki/Constant_folding
70+
//! [concurrency]: https://en.wikipedia.org/wiki/Concurrency_(computer_science)
7071
//!
7172
//! ## Out-of-order execution
7273
//!

0 commit comments

Comments
 (0)