-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
emit non-atomic instructions when --single-threaded #1911
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
Comments
Just because the current program is single threaded doesn't mean the whole machine is. e.g. you could br using memory mapped or DMAd buffers. |
volatile guarantees order and it is appropriate for DMA. From the zig docs:
It is incorrect to use atomics for DMA or memory mapped I/O. |
I do want to collect more information before committing to this. I recall needing to use |
This also came up in bindings to the linux kernel's Additionally, Which means:
I think that's probably every program in the world.... in other words, this issue can be closed. |
One thing to consider is to using the "singlethread" attribute on the atomic operations:
|
Now that #1764 is implemented, we need to improve language support for it. When building with
--single-threaded
:@atomicLoad
should be a normal (non-atomic) load@atomicRmw
should be a normal (non-atomic) read, modify, write@fence
should be a no-opThe text was updated successfully, but these errors were encountered: