atomic_dec_and_test() in FreeBSD?

Christoph Hellwig hch at infradead.org
Fri Apr 4 11:54:10 PST 2003


On Fri, Apr 04, 2003 at 02:52:21PM -0500, Garrett Rooney wrote:
> yeah, the default implementation of this function in APR uses mutexes to 
> ensure that the increment is atomic, but craig is looking for a way to 
> implement the 'platform specific faster way to do it without a mutex'.  
> worst case, we can just use the default impl on freebsd 4.x and use 
> atomic_cmpset_int on 5.x.

Just FYI, the i386 atomic.h from Linux doesn't rely on any kernel
features so you could in theory just copy it over.  But I guess the
licensing stand against this.



More information about the freebsd-smp mailing list