Re: OSAtomic
Re: OSAtomic
- Subject: Re: OSAtomic
- From: Greg Parker <email@hidden>
- Date: Mon, 18 Jan 2010 11:30:57 -0800
On Jan 18, 2010, at 11:04 AM, Derek Darwin Lists wrote:
> I believe you are misreading/mistranslating the x86 assembly implementation of OSAtomicAnd32. The compare and swap operation (cmpxchg) in the "commpage" will populate GPR EAX with the value in memory on a mismatch, so the loop on failure will restart with the "latest" value of the memory operand after the failed comparison.
That's right. You can't do that with C code and OSAtomicCompareAndSwap(), but x86 OSAtomicAnd32() is built atop other assembly code that is not identical to OSAtomicCompareAndSwap().
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden