Consider providing {has,no}_atomic_{8,16,32,64,128} helper macros
taiki-e opened this issue · comments
Taiki Endo commented
Without such helpers, it is difficult to determine which platform has which atomic operation.
Alternatives
- Provide all operations on all platforms, but panic if not supported.
- Provide lock-based fallbacks if not supported. This approach is adopted by C++ std::atomic, crossbeam AtomicCell, portable-atomic, etc., but there are problems such as global locks are not the best from a performance standpoint (although per-object locks cannot be used because it breaks API guarantees), adding extra binary size when it is not used, etc.