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

Question about the memory ordering of the store in the last fence example in chapter 3 #50

Open
orium opened this issue Jan 23, 2024 · 0 comments
Labels

Comments

@orium
Copy link

orium commented Jan 23, 2024

The content that the question is about

The store in READY: https://github.com/m-ou-se/rust-atomics-and-locks/blob/main/examples/ch3-11-fence.rs#L17

The question

The atomics in READY are only read with Relaxed ordering in line 21. Can't the store in line 17 be done with memory ordering Relaxed (instead of Release), since relaxed is enough to establish a total order between stores and loads of the same variable?

@orium orium added the question label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant