chapel icon indicating copy to clipboard operation
chapel copied to clipboard

Add support for atomic min and max

Open mppf opened this issue 5 months ago • 0 comments

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 and fetch_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

mppf avatar Sep 06 '24 18:09 mppf