Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Apr 2003 14:52:21 -0500
From:      Garrett Rooney <rooneg@electricjellyfish.net>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        freebsd-smp@FreeBSD.org
Subject:   Re: atomic_dec_and_test() in FreeBSD?
Message-ID:  <3E8DE275.6040000@electricjellyfish.net>
In-Reply-To: <XFMail.20030404144550.jhb@FreeBSD.org>
References:  <XFMail.20030404144550.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin wrote:

>>I believe Craig is looking for a user space solution, not kernel space.
>>    
>>
>
>Argh, I couldn't remember.  Well, one could always use a mutex to
>protect the count I suppose.  One must be using some sort of threads
>library for this to even make sense in userland.
>

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.

-garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E8DE275.6040000>