Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] RFC: add atomic compare-and-swap that returns old value
From: Nathan Hjelm (hjelmn_at_[hidden])
Date: 2014-07-29 17:10:16


What: Add new versions of opal_atomic_cmpset_* that return the old value
not whether they succeeded.

Why: I plan on adding support for network atomics to the BTL
interface. The compare-and-swap function will return the old value from
the target memory location. In order to implement a similar operation
for shared memory (in vader) I need versions of the opal_atomic_cmset_*
macros that return the old value.

When: If there are no objections I plan on adding these new macros in
about two weeks (Aug 12).

I have one question associated with this RFC. Is there a reason why the
current implementations of opal atomics (add, cmpset) do not return the
old value? cmpset sort of makes sense but I found the semantics of
opal_atomic_add_* confusing (returns the new value).

-Nathan



  • application/pgp-signature attachment: stored