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

zeroize: Remove CPU fences #216

Merged
merged 1 commit into from Jun 4, 2019
Merged

Conversation

tony-iqlusion
Copy link
Member

Per @RalfJung:

#214 (comment)

AFAIK atomic fences only really prevent reordering of atomic accesses.
Non-atomic accesses can still be reordered. The interaction of this
with volatile accesses is entirely unclear -- technically, they are
non-atomic, but in practice it seems unlikely that the compiler would
perform such reorderings.
[...]
A compiler fence seems like a reasonable precaution and also helps
make sure the side-effects happens near where the programmer might
expect it, but a CPU fence to me sounds more like cargo cult.

Per @RalfJung:

#214 (comment)

> AFAIK atomic fences only really prevent reordering of atomic accesses.
> Non-atomic accesses can still be reordered. The interaction of this
> with volatile accesses is entirely unclear -- technically, they are
> non-atomic, but in practice it seems unlikely that the compiler would
> perform such reorderings.
> [...]
> A compiler fence seems like a reasonable precaution and also helps
> make sure the side-effects happens near where the programmer might
> expect it, but a CPU fence to me sounds more like cargo cult.
@tony-iqlusion tony-iqlusion merged commit 7dc75e1 into develop Jun 4, 2019
@tony-iqlusion tony-iqlusion deleted the zeroize/remove-cpu-fences branch June 4, 2019 21:44
@tony-iqlusion tony-iqlusion mentioned this pull request Jun 4, 2019
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

1 participant