httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject Re: thread-safety of time conversion caches in util_time.c and mod_log_config.c
Date Sat, 05 Jan 2013 09:57:08 GMT
On Saturday 05 January 2013, Daniel Lescohier wrote:
> apr_atomic_read32 is not implemented with a memory barrier.  The
> implementation of apr_atomic_read32 in the APR code base is just a
> read from a pointer marked volatile.  E.g., here is the
> atomic/unix/builtins.c implementation:
> 
> APR_DECLARE(apr_uint32_t) apr_atomic_read32(volatile apr_uint32_t
> *mem)
> {
>     return *mem;
> }

Sigh. I was too much focused on x86. There the compiler barrier caused 
by the function call is enough. But you are right, on other 
architectures these functions may also require cpu memory barriers.

The functions are meant to include the barriers, according to the 
documentation in apr_atomic.h. So they should be fixed in apr.

Mime
View raw message