On Mon, Jun 30, 2014 at 08:17:19AM -0700, Jarno Rajahalme wrote: > Add support for atomic compare_exchange operations. > > Add ovs_refcount_try_ref(), which takes a reference only if the > refcount is non-zero and returns true if a reference was taken, false > otherwise. This can be used in combined RCU/refcount scenarios where > we have an RCU protected reference to an refcounted object, but which > may be unref'ed at any time. If ovs_refcount_try_ref() fails, the > object may still be safely used until the current thread quiesces. > > Signed-off-by: Jarno Rajahalme <jrajaha...@nicira.com>
I doubt that "relaxed" memory order is good enough here, given the commentary on the previous patch. Not every architecture supports compare-and-exchange, but it sounds like probably the ones we care about do (do we need to support ARMv6 or PA-RISC?). _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev