On 11/12/2010 01:19 PM, Mathieu Desnoyers wrote:
* Paolo Bonzini ([email protected]) wrote:
Return nothing can be useful because it can be optimized on x86 as "lock
orl (mem), reg/imm". However, there are no other return-nothing atomic
ops in uatomic_*.h so I decided not to provide this.
How about we start by implementing uatomic_and/uatomic_or that return
void, and if we ever need uatomic_return_and/uatomic_return_or (see my
other mail), we add them ?
I am using uatomic_or's return value in my call_rcu-with-futex, but I
don't need atomic-or-and-exchange really, I can even change it to a load
followed by an atomic or (it introduces a race but it is benign). Or I
can certainly use cmpxchg too. Updated patches will come.
Should I rename uatomic_add to uatomic_xchg_add too (I prefer this name
to uatomic_return_add)?
Paolo
_______________________________________________
ltt-dev mailing list
[email protected]
http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev