apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Justin Erenkrantz" <jus...@erenkrantz.com>
Subject Re: Patch 1 for apr_atomic.c (Solaris 10)
Date Mon, 30 Oct 2006 06:24:06 GMT
On 10/29/06, Colin <share-apache@think42.com> wrote:
> Unfortunately I don't have access to a Solaris 10 machine, so
> this patch is untested (I will be able to test all subsequent
> patches though ;-)

I have Sol10 machines.  =)

> Changes to the Solaris 10 specific functions
> - Fixed atomic_set_32 by adding an appropriate memory barrier.

This doesn't make a whole lot of sense.  Just by calling
apr_atomic_read32(), we get a memory barrier which is only released by
apr_atomic_set32().  Why does reading an atomic mean that no one else
can update it ever?  What happens if we call a read() without a set()?
 At what other point would it be unlocked?

> - Added missing implementations for atomic_read32, atomic_add32,
>   atomic_sub32 and atomic_casptr.

These look fine, AFAICT.

> - Moved #include <atomic.h> into the Solaris 10 section;
>   prevents redundant include if generic implementation is used.


> - Fixed atomic_dec_32 and atomic_inc_32; the old versions were
>   NOT actually atomic because (a) there was no guarantee that
>   *mem was not changed between reding the value and performing
>   the atomic update, and (b) the read itself was not preceeded
>   by an appropriate memory barrier.

*nod*  -- justin

View raw message