2 ms·
All the (C++) defaults are wrong, of course. But in this case I believe the choice to have a default was itself the error. I have been persuaded that either yo
by tialaramex 3y ago
All the (C++) defaults are wrong, of course.
But in this case I believe the choice to have a default was itself the error. I have been persuaded that either you know which Ordering you need, and thus you should specify what you meant - or else you should not be using these APIs at all. If you aren't confident of the correct Ordering, you are not in fact confident your algorithm is correct, so don't do it.
- gpderetta 3y agoYou are not wrong; still an std::atomic variant that defaulted to mo_release on assignment, mo_acquire on load and mo_aq_rel on RMW would have covered 99% of my use cases. Then again, I usually target x86 where these defaults are optimal, in other architectures relaxing RMWs further has benefits.