On Mon, 2006-03-06 at 19:29 +0200, Michael S. Tsirkin wrote:
> The right thing to do is to look at the implementation
> and write your own for architectures that matter.
> Use lock for others.
If performance at that point is *that* critical...
I used the following in the past for x86. Tested on 32bit only.
That's my own code, not my employers. So, I donate it, fwiw.
inline void AtomicInc(int volatile& x) {
__asm__ volatile ("lock\nincl %0" : : "m" (x));
}
inline void AtomicDec(int volatile& x) {
__asm__ volatile ("lock\ndecl %0" : : "m" (x));
}
--
Jean-Christophe Hugly <[EMAIL PROTECTED]>
PANTA
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general