-
Notifications
You must be signed in to change notification settings - Fork 59
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
Our concurrency memory model (inherited from C++20) is incompatible with x86 #548
Comments
Having read the issue, I'm not sure that it's incompatible. It's just that it's universally miscompiled. The issue is that compiling it properly will make it a stupid amount slower (and I'm not sure C++ users will appreciate the perf regresssiom). Specifically, putting an mfence after each mov for a SeqCst load would be sufficient, as would using lock cmpxchg/cmpxchg8b on targets without SSE. Though this means that non-sse can't compile any SeqCst loads in a manner that is compatible with accessing read-only memory. |
This problem should not occur as LLVM can emit a |
Well, it is incompatible with the intended lowering. Changing the lowering is the wrong fix for this.
|
Well without changing our memory model or bugging WG-21, I'm not sure what the "right fix" would be. |
I like this comment from the report
I definitely agree that just defining the relevant orders and consistency axioms would be much better than trying to circumscribe them in standardese. Even if the definition is carried out in English, as long as its translation into formal syntax is clear, that seems much better than the current approach the C++ standard is taking.
It's very clear from the document I linked above that this is a mistake they made when translating the formal notation from the paper into plain English:
|
See https://cplusplus.github.io/LWG/lwg-active.html#3941 for details. Thanks @orilahav for pointing this out to me.
The text was updated successfully, but these errors were encountered: