From dfa9736e9f5b9e5650fea5faed6dc7d446772eb4 Mon Sep 17 00:00:00 2001 From: Geoff Yoerger Date: Thu, 19 Jan 2017 21:43:34 -0600 Subject: [PATCH] Clarify the `default` option to use --- src/libcore/sync/atomic.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index bd1d00486ec..3d274d17c7c 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -140,10 +140,15 @@ unsafe impl Sync for AtomicPtr {} /// to be moved either before or after the atomic operation; on the other end /// "relaxed" atomics allow all reorderings. /// +/// If you are confused or don't have enough time to research which ordering to use, use `SeqCst`. +/// Of all the options it has the most unsurpising effect (see the nomicon for details. [1]) +/// The downside is you miss out on several optimizations the other orderings offer. +/// /// Rust's memory orderings are [the same as /// LLVM's](http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations). /// -/// For more information see the [nomicon](https://doc.rust-lang.org/nomicon/atomics.html). +/// For more information see the [nomicon][1]. +/// [1]: https://doc.rust-lang.org/nomicon/atomics.html #[stable(feature = "rust1", since = "1.0.0")] #[derive(Copy, Clone, Debug)] pub enum Ordering {