apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Trawick" <traw...@gmail.com>
Subject Re: API to prevent further allocations from a pool?
Date Thu, 07 Sep 2006 16:29:19 GMT
On 9/7/06, Nick Kew <nick@webthing.com> wrote:
> On Thursday 07 September 2006 16:22, Jeff Trawick wrote:
> > It would be cool for the MPM to be able to lock the pool once it is
> > ready to start serving requests so that if any errant module tries to
> > use pconf, pchild, etc. it will crash immediately instead of
> > introducing memory corruption under load.  (Even if the module author
> > is "clever" and uses a mutex around the pool use, that assumes she is
> > the only person in the world to have that idea.)
>
> There are cases where using pchild can be the lesser evil.
> Example: managing a persistent resource that supports infrequent
> delete or timeout.  If a module creates a private pool at child_init,
> that'll make a slow leak.

allocating from pchild is also a slow leak
allocating from pchild is not threadsafe unless you mutex around your
alloc calls AND no other module in the server had the same idea
a private pool is the only solution short of avoiding pools altogether

Mime
View raw message