Skip to content

Commit dfa9736

Browse files
authored
Clarify the default option to use
1 parent 02ead27 commit dfa9736

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libcore/sync/atomic.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,15 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
140140
/// to be moved either before or after the atomic operation; on the other end
141141
/// "relaxed" atomics allow all reorderings.
142142
///
143+
/// If you are confused or don't have enough time to research which ordering to use, use `SeqCst`.
144+
/// Of all the options it has the most unsurpising effect (see the nomicon for details. [1])
145+
/// The downside is you miss out on several optimizations the other orderings offer.
146+
///
143147
/// Rust's memory orderings are [the same as
144148
/// LLVM's](http://llvm.org/docs/LangRef.html#memory-model-for-concurrent-operations).
145149
///
146-
/// For more information see the [nomicon](https://doc.rust-lang.org/nomicon/atomics.html).
150+
/// For more information see the [nomicon][1].
151+
/// [1]: https://doc.rust-lang.org/nomicon/atomics.html
147152
#[stable(feature = "rust1", since = "1.0.0")]
148153
#[derive(Copy, Clone, Debug)]
149154
pub enum Ordering {

0 commit comments

Comments
 (0)