You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Bojan Smojver <bo...@rexursive.com> on 2002/11/01 06:48:44 UTC
Pool common to all processes/threads
Just reading through the documentation to find if there is a single pool that
all processes/threads have access to, without mucking around with direct shared
memory allocation. So far, couldn't fine one in Apache 2. Does it exist?
Bojan
Re: Pool common to all processes/threads
Posted by Bojan Smojver <bo...@rexursive.com>.
On Fri, 2002-11-01 at 17:08, Brian Pane wrote:
> On Thu, 2002-10-31 at 21:48, Bojan Smojver wrote:
> > Just reading through the documentation to find if there is a single pool that
> > all processes/threads have access to, without mucking around with direct shared
> > memory allocation. So far, couldn't fine one in Apache 2. Does it exist?
>
> There isn't a cross-process pool. Some MPMs have a "pconf" pool
> that exists at a global scope within each process, but it's not
> really usable by the request-handling threads. In order to achieve
> high performance, apr_palloc() doesn't do any locking, so each pool
> can only be used safely by one thread at a time.
Thanks.
An interesting idea would be to have a really global pool which would be
read-write. However, all other pools don't have to be thread safe. An
interesting library in that area is libslack (http://libslack.org/)
where everything is MT-disciplined
Bojan
Re: Pool common to all processes/threads
Posted by Brian Pane <br...@cnet.com>.
On Thu, 2002-10-31 at 21:48, Bojan Smojver wrote:
> Just reading through the documentation to find if there is a single pool that
> all processes/threads have access to, without mucking around with direct shared
> memory allocation. So far, couldn't fine one in Apache 2. Does it exist?
There isn't a cross-process pool. Some MPMs have a "pconf" pool
that exists at a global scope within each process, but it's not
really usable by the request-handling threads. In order to achieve
high performance, apr_palloc() doesn't do any locking, so each pool
can only be used safely by one thread at a time.
Brian
Re: Pool common to all processes/threads
Posted by Bojan Smojver <bo...@rexursive.com>.
Thanks Brian and Bill.
Bojan
On Fri, 2002-11-01 at 17:11, William A. Rowe, Jr. wrote:
> At 11:48 PM 10/31/2002, Bojan Smojver wrote:
> >Just reading through the documentation to find if there is a single pool that
> >all processes/threads have access to, without mucking around with direct shared memory allocation. So far, couldn't fine one in Apache 2. Does it exist?
>
> If you are looking for config-time write, later read-only, use the process pool
> you can find from the server rec. You must set it up early, you can't modify
> stuff in it later.
>
> If you want full blown read-write access, you must create your own apr_shm.
> You can wrap that in an apr_rmm, if you want malloc/realloc/free behavior
> in that shared memory block.
Thanks.
Bojan
Re: Pool common to all processes/threads
Posted by "William A. Rowe, Jr." <wr...@apache.org>.
At 11:48 PM 10/31/2002, Bojan Smojver wrote:
>Just reading through the documentation to find if there is a single pool that
>all processes/threads have access to, without mucking around with direct shared memory allocation. So far, couldn't fine one in Apache 2. Does it exist?
If you are looking for config-time write, later read-only, use the process pool
you can find from the server rec. You must set it up early, you can't modify
stuff in it later.
If you want full blown read-write access, you must create your own apr_shm.
You can wrap that in an apr_rmm, if you want malloc/realloc/free behavior
in that shared memory block.