Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain the atomic orderings used in race #175

Merged
merged 2 commits into from Mar 19, 2022

Conversation

Kestrer
Copy link
Contributor

@Kestrer Kestrer commented Mar 17, 2022

I believe this is the correct rationale as to why those atomic orderings were chosen in this module. This change also makes it explicit that those orderings are used in the library's public API, better allowing consumers to safely depend on it.

src/race.rs Outdated Show resolved Hide resolved
@matklad
Copy link
Owner

matklad commented Mar 17, 2022

Good call! We indeed should document acq/rel guarantee!

//! it, it's possible for it to appear as if they haven't happened yet from the
//! getter thread's perspective. This is an acceptable tradeoff to make since
//! `Acquire` and `Release` have very little performance overhead on most
//! architectures versus `Relaxed`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Bonus points if you can add a "litmus test" example here!

@matklad
Copy link
Owner

matklad commented Mar 18, 2022

bors d+

@bors
Copy link
Contributor

bors bot commented Mar 18, 2022

✌️ Kestrer can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@Kestrer
Copy link
Contributor Author

Kestrer commented Mar 19, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 19, 2022

Build succeeded:

@bors bors bot merged commit b57c774 into matklad:master Mar 19, 2022
@Kestrer Kestrer deleted the race-orderings branch March 19, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants