-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
struct RelaxedAtomic
: Replace Atomic*
s that use only relaxed ops …
…with `RelaxedAtomic` (#1192) * Fixes #1173. `RelaxedAtomic` requires `Ordering::Relaxed` loads and stores, disallowing other relaxed ops like `.fetch_or`. The former are always plain loads and stores, while the latter are contended `lock *` instructions, so this ensures `RelaxedAtomic`s have little to no overhead. It also makes clear which types are meant to be fully relaxed. This should fix #1173 because it removes all relaxed `.fetch_*`es and replaces them with `.update`s, which do separate relaxed loads and stores, which don't have overhead. This may replace an `add` with a load, `add`, and store, for example, but it gets rid of the `lock add`, which can cause contention, so it should generally have little to no overhead over no atomics at all.
- Loading branch information
Showing
12 changed files
with
319 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.