Subject: Re: Atomic ops API
To: Andrew Doran <ad@netbsd.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 03/13/2007 09:58:50
On Mar 13, 2007, at 8:49 AM, Andrew Doran wrote:

>
>> Maybe add a note that everything besides the cas operations might be
>> a lot more expensive than i386-minded people might assume (naively
>> ignoring the runtime costs at the hardware bus level)?
>
> Any MP atomic instruction on x86 can cost around 150 cycles on newer
> CPUs. They're not cheap there either!

Yes, once the API is there, we'll want to revisit the underlying  
implementation on some platforms.  For UP x86, for example, we won't  
need the lock prefix, fences, etc.

-- thorpej