httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Bannert <>
Subject Re: [PATCH] Use mutex locks in mod_specweb99.c
Date Fri, 13 Dec 2002 16:50:56 GMT

On Thursday, December 12, 2002, at 12:34  PM, Greg Ames wrote:
> I dug into APR locks a little bit.  The apr_global_mutex_* functions 
> turn into two separate syscalls, with #if APR_HAS_THREADS around the 
> thread mutexing.  So unfortunately they wouldn't save us any syscalls 
> :-( :-(  But they might save a little bit of function call overhead.
> Another interesting place to look is in 
> srclib/apr/include/arch/unix/apr_private.h .
> There are several xxxx_IS_GLOBAL symbols for various serialization 
> mechanisms. On my Linux box, all of them are #undef'ed and commented 
> out, including fcntl and flock which are the two choices for 
> apr_file_lock.  Madhu, could you take a look there and see what you've 
> got?

You really shouldn't use those xxxx_IS_GLOBAL symbols for anything 
outside of APR.
They are there for platforms like s390 where some of the file-based 
locks do actually
serialize multiple threads within multiple processes.

If you're worried about the overhead of calling pthread_lock and 
under the covers when it's not needed (like on the prefork MPM) then I 
say that's not a big problem. Locking mutexes that are not contended 
for can
be quite cheap, and often those calls do not even translate into 


View raw message