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

Is Ordering::Relaxed strong enough? #4

Open
fzyzcjy opened this issue Nov 14, 2022 · 1 comment
Open

Is Ordering::Relaxed strong enough? #4

fzyzcjy opened this issue Nov 14, 2022 · 1 comment

Comments

@fzyzcjy
Copy link

fzyzcjy commented Nov 14, 2022

Hi, I wonder whether Relaxed is strong enough or not? https://doc.rust-lang.org/std/sync/atomic/enum.Ordering.html says:

No ordering constraints, only atomic operations.

Thus, it may look reasonable to allow users to configure it. For example, a user who wants the counter to be visible to all threads may need a stronger guarantee.

@JackThomson2
Copy link
Owner

I used relaxed as the sum is never going to be exact due to the sharding. Making it configurable sounds a good idea though, I'll add that in!

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

No branches or pull requests

2 participants