From: EXT Ola Liljedahl [mailto:ola.liljed...@linaro.org]
Sent: Thursday, October 15, 2015 11:00 PM
To: Savolainen, Petri (Nokia - FI/Espoo)
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [API-NEXT PATCH 5/6] api: atomic: added cas operations

On 15 October 2015 at 10:45, Petri Savolainen 
<petri.savolai...@nokia.com<mailto:petri.savolai...@nokia.com>> wrote:
Added cas operations for 32 and 64 bit atomic variables. These
use relaxed memory order (as all other operations).
Do you have actual use cases for CAS where *only* relaxed memory order is 
required? Or you need CAS with acquire ordering per the other patch? But you 
don't need CAS with release ordering?

CAS with relaxed order is for implementing e.g. min / max of a counter. User 
inc / dec a count and update atomic variables min/max with CAS. This is what 
Barry needed in one of the calls.


I would rather see a generic CAS function with the memory order as a separate 
parameter. We are into lock-less territory now, not just using atomics for 
simple counters/statistics where we don't have to worry about memory ordering.

This is still for simple couters.

-Petri



_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to