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

[atomics.types.operations]p20's note makes incorrect assumptions about atomic representation #2104

Open
zygoloid opened this issue Jun 7, 2018 · 4 comments
Labels
sg1 Issue must be reviewed by SG1.

Comments

@zygoloid
Copy link
Member

zygoloid commented Jun 7, 2018

[ Note: For example, the effect of compare_exchange_strong is

if (memcmp(this, &expected, sizeof(*this)) == 0)
  memcpy(this, &desired, sizeof(*this));
else
  memcpy(expected, this, sizeof(*this));

end note ]

This is wrong in a multitude of ways... not least of which is that that's not even atomic. But also this assumes that sizeof(atomic<T>) == sizeof(T), that the layout of an atomic directly contains a T, and so on.

@jensmaurer
Copy link
Member

Do we want to deal with this editorially, or have SG1 chime in?

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Jun 28, 2018
@jwakely
Copy link
Member

jwakely commented Jun 28, 2018

IIRC SG1 came up with that example, so I think getting their input would be best.

@jensmaurer jensmaurer added the lwg Issue must be reviewed by LWG. label Jun 28, 2018
@jfbastien
Copy link
Contributor

I can whip up a paper that fixes it if you think that's helpful? Another approach would be to wait for us to say that atomic contains a T, which we're working on for the next mailing. Then we can fix this more easily example (perhaps even in the same paper).

@jensmaurer jensmaurer added sg1 Issue must be reviewed by SG1. and removed lwg Issue must be reviewed by LWG. labels Oct 11, 2018
@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Nov 6, 2018
@jensmaurer
Copy link
Member

Editorial meeting: Yes, need SG1 input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sg1 Issue must be reviewed by SG1.
Projects
None yet
Development

No branches or pull requests

4 participants