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

Memory ordering #4

Open
inspirit opened this issue Jun 19, 2015 · 2 comments
Open

Memory ordering #4

inspirit opened this issue Jun 19, 2015 · 2 comments

Comments

@inspirit
Copy link

can we relax compare_exchange_weak with different memory orders?

I would assume that for push operation we can do memory_order_release and memory_order_relaxed

and for pop: memory_order_release and memory_order_acquire

any thought on that?

@skeeto
Copy link
Owner

skeeto commented Jun 19, 2015

I don't understand C11 memory ordering well enough to say what other
memory orderings are correct, and that part of the C11 spec is too dense
for me to follow. And since it doesn't make any difference on x86 --
where a locked cmpxchg is always going to be a full memory barrier -- I
couldn't really test it either.

@inspirit
Copy link
Author

yeah memory order might make sense if 64bit head used instead of 128bits

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