httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sindhi Sindhi <sindhi....@gmail.com>
Subject Apache pool management
Date Fri, 24 May 2013 18:00:40 GMT
Hi,

I did an initial study to find out more information about Apache APR pools.
Some links say pools are not thread safe, some say they are really useful,
so I'm a bit confused. Kindly advice.

In certain links like the below, I read that pools are not thread safe.
Does this mean that when multiple requests are being handled by multiple
threads in Apache, data of one request could get overwritten/read/freed by
other requests?
http://mail-archives.apache.org/mod_mbox/apr-dev/200502.mbox/%3C1f1d9820502241330123f955f@mail.gmail.com%3E

A lot of other links like the below state that pools are a big advantage in
Apache memory management.
http://structure.usc.edu/svn/svn.developer.pools.html
http://dev.ariel-networks.com/apr/apr-tutorial/html/apr-tutorial-3.html

To summarize my requirement, I have written a C++ output filter module that
filters HTML. And this module will be invoked by multiple requests that hit
the server at the same time. My concern about using the APR pool is, if I
use the request pools, when one request (say request1) is in the middle of
processing, I do not want this request's data to be corrupted by other
requests'(say request2) - like, request2 overwriting on request1's data or
request2 freeing the memory allocated by request1.

If you can answer the below questions that will help me make a better use
or APR pool, kindly reply.
1. Can I use the request pools in such a way that, each request owns its
pool and cannot be read/written/freed by other requests/pool manager? What
settings in httpd-mpm.conf will make this possible?
2. I get the "ap_filter_t *f" as an input to my filter module, and I'm
using the f->r->pool to allocate memory that is used by my filter module.
So is this pool unique for every request?

Would appreciate a response.

Thanks.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message