apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@ebuilt.com>
Subject thread locking within apr file io
Date Thu, 26 Apr 2001 04:49:58 GMT
APR file io, when compiled with APR_HAS_THREADS (the default unless it
is specifically disabled or on a non-thread platform), is acquiring
mutex locks on every buffered file read or write.  That is lunacy.
Whether or not locking is necessary must be decided by the caller,
not by the library.  The normal behavior is for buffers to be
thread-specific, and thus never need mutexing.

BTW, the same can be said for pools -- right now it is locking all
pool operations, even though the only ones that need locking are those
shared by multiple threads (the global pools).  Bogus.

This stuff came up while Justin and Aaron were performance testing 
mod_mbox -- right now you can double the requests per second simply
by recompiling with --disable-threads.


View raw message