-
Notifications
You must be signed in to change notification settings - Fork 252
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
Use Acquire
ordering for initialization check
#610
Use Acquire
ordering for initialization check
#610
Conversation
Reasoning is provided in the code comment.
This generates different code than current for |
It seems the ordering was changed from @sfackler you wrote the code, but the commit message doesn't mention why. Do you know of a good reason not to merge this? |
@Thomasdezeeuw It seems that @sfackler wouldn't respond. Anyway, this old code was very different (e.g. it uses refcounting, and with too strong orderings too, Arc, for example, uses mostly acquire and relaxed orderings). I wrote the comment in code that explains why Acquire ordering is correct and enough. With atomics, in general, it is preferable to use weakest as possible but still correct ordering because stronger ordering does make whole CPU slower, especially, if called frequently. |
If I remember correctly, it was Alex’s general preference to use stronger orderings to avoid potential correctness issues. I wouldn’t read to much into it if people are confident that a weaker ordering is sufficient. |
Thanks @sfackler Then I think we can merge this. |
Thanks @AngelicosPhosphoros |
Reasoning is provided in a comment.