tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <p...@betaversion.org>
Subject Re: apr pools in mod_webapp
Date Mon, 08 Apr 2002 14:49:21 GMT
simonkeary@eircom.net <simonkeary@eircom.net> wrote:

> My understanding (so far) is that an apr pool essentially makes memory cleanup
> a bit easier by cleaning up all datastructures associated with it when it is
> destroyed.  This removes the need to cleanup all datastructures individually
> and makes memory leaks less likely.  As far as I can see the only way to
> cleanup a data structure associated with a pool is to free the entire pool.
> Is this correct? 

Yessir, very....

> In this way, the pool does not behave like many common pool
> implementations which have alloc() and free() methods and are basically there
> to prevent memory allocation routine overhead.

Correct...

> If anyone could fill me in on more details or point me to some documentation,
> that would be great!

You're pretty much right...

Anyhow, pointer: a pool of sockets is different from an APR memory pool...
You can _tie_ those two to provide a cleanup of sockets when the pool gets
destroyed (then basically when everything goes down), but mostly, all the
socketpool code needs to be written...

And be sure to use the new locking mechanism in APR (threadproc locking, not
apr_lock)...

    Pier


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message