chapel
chapel copied to clipboard
Add support for atomic min and max
This PR adds support for atomic min and max. While there is an expectation that these signatures can be stable, this PR adds them as unstable for now.
See issue #22867 which requests this functionality.
What do other languages do here?
- C++ has a proposal https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf which adds
atomic_fetch_min
/atomic_fetch_max
(and also_explicit
variants of these to allow providing the memory order). - Rust has
fetch_min
andfetch_max
(see e.g. https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU32.html#method.fetch_max)
Future Work:
- add NetworkAtomics versions of these
- [ ] full comm=none testing
- [ ] add chpldoc docs comments