diff options
| author | Geoff Yoerger <geoffreyiy1@gmail.com> | 2017-01-19 21:43:34 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-19 21:43:34 -0600 |
| commit | dfa9736e9f5b9e5650fea5faed6dc7d446772eb4 (patch) | |
| tree | ab4d9685c7beb160bedfc04bcca402e6239c7d2c /src/libcore/sync | |
| parent | 02ead27c935887b148e58df999dbd8fb9be9d789 (diff) | |
| download | rust-dfa9736e9f5b9e5650fea5faed6dc7d446772eb4.tar.gz rust-dfa9736e9f5b9e5650fea5faed6dc7d446772eb4.zip | |
Clarify the `default` option to use
Diffstat (limited to 'src/libcore/sync')
| -rw-r--r-- | src/libcore/sync/atomic.rs | 7 |
1 files changed, 6 insertions, 1 deletions
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<T> Sync for AtomicPtr<T> {} /// 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 { |
