From 7e921aa59090096593cb4fa202041c91a5d1e36b Mon Sep 17 00:00:00 2001 From: Gabriel Majeri Date: Fri, 28 Sep 2018 10:59:45 +0300 Subject: Rewrite section on concurrency --- src/libstd/sync/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/libstd/sync') diff --git a/src/libstd/sync/mod.rs b/src/libstd/sync/mod.rs index 5ba569bf7ce..edbed430e38 100644 --- a/src/libstd/sync/mod.rs +++ b/src/libstd/sync/mod.rs @@ -57,16 +57,17 @@ //! as the final optimized code, when executed, produces the same results as the one //! without optimizations. //! -//! When multiprocessing is involved (either multiple CPU cores, or multiple -//! physical CPUs), access to global variables (which are shared between threads) -//! could lead to nondeterministic results, **even if** compiler optimizations -//! are disabled. +//! Due to the [concurrency] involved in modern computers, assumptions about +//! the program's execution order are often wrong. Access to global variables +//! can lead to nondeterministic results, **even if** compiler optimizations +//! are disabled, and it is **still possible** to introduce synchronization bugs. //! //! Note that thanks to Rust's safety guarantees, accessing global (static) //! variables requires `unsafe` code, assuming we don't use any of the //! synchronization primitives in this module. //! //! [constant folding]: https://en.wikipedia.org/wiki/Constant_folding +//! [concurrency]: https://en.wikipedia.org/wiki/Concurrency_(computer_science) //! //! ## Out-of-order execution //! -- cgit 1.4.1-3-g733a5