apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colin Hirsch <share-apa...@think42.com>
Subject Re: Atomic Operations Assembly
Date Fri, 15 Sep 2006 09:02:29 GMT
> Also, please use diff -u :-)

Attached is the output of diff -u against version 1.2.7; again only
atomic/unix/apr_atomic.c was affected.

Added: Sparc atomic primitives for v9 architectures, requires -mcpu=v9
  to compile!

Fixed: Changed Intel atomic primitives to use input/output parameters
  wherever possible and/or necessary.

Added: A comment "// TODO: read memory barrier" wherever one is missing;
  the memory barrier is not necessary on x86, but on most other archs.

Fixed: As I noted in a previous post, the PowerPC implementation of 
  apr_atomic_add32() and apr_atomic_cas32() can produce a livelock on
  some PowerPC 970 chips like the 970MP in my PowerMac, I have therefore
  put the respective code in a "#if 0".

If memory barriers are used correctly, then the "volatile" can be 
removed from the declaration of all "volatile apr_uint32_t * mem"
function arguments; only select few accesses need to cast the pointer
to volatile when performing the access; this change will (a) likely
produce better code for when the access need not be explicitly
volatile [again], like when a mutex is used, and (b) make it more
likely to trigger existing bugs (volatile alone does not fix them).

Regards, Colin

View raw message