3 ms·
If you wanted to do this, which to be clear I certainly don't think you should, the way to approach it would probably go like this: 1. Add new unsafe relaxed a
by tialaramex 5y ago
If you wanted to do this, which to be clear I certainly don't think you should, the way to approach it would probably go like this:
1. Add new unsafe relaxed atomics features, by whatever means. Being new there's no backward compatibility worry.
2. Modify the existing safe atomics to treat Relaxed as Acquire-release. This doesn't break anything since Acquire-release is necessarily not breaking Relaxed guarantees, although of course some code now has worse performance than before.
Edited to add: Also, what do you mean you can use Consume today in Rust? Where? My std::sync::atomic::Ordering doesn't even list Consume as an option.
- steveklabnik 5y agoI was wrong about consume.
- zozbot234 5y agoBTW, the likely reason is that newer C/C++ standards also include a warning that the "consume" memory ordering has unclear semantics and should not be used. It can be replaced by acquire which provides stronger guarantees.