You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ryan Bloom <rb...@ntrnet.net> on 1999/08/27 21:41:28 UTC
Apache using apr.
Ok, I have re-created the patch for Apache to use APR contexts. The
contexts have changed according to my message from earlier today. Namely:
context {
ap_pool_t *pool;
void *prog_data;
}
I am putting the whole tar ball at:
http://www.ntrnet.net/rbb/new_apache/apache-2.0-currentapr.tar.gz
I know it's long, soory.
My reasons for keeping the contexts. 1) There are enough places inside
APR where I have to allocate memory, I need some way to do this. 2) Dean
commented yesterday that there may be situations where we want multiple
allocation techniques within the same server. By having a context which
can point to ALL of these techniques at any time, our function prototypes
are cleaner.
I will be posting another copy of Apache with APR later this weekend.
This copy will hav:
ap_pool_t, and apr will implement the pools, and will expect the program
to provide pre-allocated memory for all functions. In places where apr
needs to allocate memory, it will use malloc, and free.
I would like to commit one of these or the other EARLY next week. Please
voice your opinions about which is better soon.
In the meantime, play with what I am posting now. It should be there in
about five minutes.
Ryan
_______________________________________________________________________________
Ryan Bloom rbb@ntrnet.net
6209 H Shanda Dr.
Raleigh, NC 27609 Ryan Bloom -- thinker, adventurer, artist,
writer, but mostly, friend.
-------------------------------------------------------------------------------
Re: Apache using apr.
Posted by Dean Gaudet <dg...@arctic.org>.
On Wed, 8 Sep 1999, Greg Stein wrote:
> Dean Gaudet wrote:
> >
> > On Fri, 27 Aug 1999, Greg Stein wrote:
> >
> > > We should use contexts so that the user data can be carried around. Dean
> > > suggested added a void* to the pool structure. That is a bit silly as
> > > that means pools are no longer just memory handling types, but include
> > > other stuff. The best label to apply for that case is "context".
> >
> > note if you see my other post about supporting all types of allocation
> > within one pool you'll see that it'd be cool for the different allocators
> > to have a void * that they can allocate within the pool...
>
> I'm not sure that I follow what you're getting at here. Would the
> allocator use the void* internally? Well, sure... that makes sense. I
> would expect them to have some kind of private storage in there.
i mean the allocator would use the void * provided by the context, the
allocator needs somewhere to hang its private data.
> Or do you mean something about exposing the void* to users? In that
> case, then you're monkeying up the abstraction between allocators and
> context storage.
private.
Dean
Re: Apache using apr.
Posted by Greg Stein <gs...@lyra.org>.
Dean Gaudet wrote:
>
> On Fri, 27 Aug 1999, Greg Stein wrote:
>
> > We should use contexts so that the user data can be carried around. Dean
> > suggested added a void* to the pool structure. That is a bit silly as
> > that means pools are no longer just memory handling types, but include
> > other stuff. The best label to apply for that case is "context".
>
> note if you see my other post about supporting all types of allocation
> within one pool you'll see that it'd be cool for the different allocators
> to have a void * that they can allocate within the pool...
I'm not sure that I follow what you're getting at here. Would the
allocator use the void* internally? Well, sure... that makes sense. I
would expect them to have some kind of private storage in there.
Or do you mean something about exposing the void* to users? In that
case, then you're monkeying up the abstraction between allocators and
context storage.
> and as far as usage for the void *, we need some sort of unique identifier
> for each user of the pool. ken suggested the module number method, but of
> course that doesn't work within APR, because modules are an apache thing.
atoms.
At a minimum, that damn "table" type really has to change. The "values
are strings" thing is just a horrendous pain. I want a name => void*
mapping. Hell, I want binary-blob => void* mappings. Where are those
Python dictionaries when you need 'em? :-)
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
Re: Apache using apr.
Posted by Dean Gaudet <dg...@arctic.org>.
On Fri, 27 Aug 1999, Greg Stein wrote:
> We should use contexts so that the user data can be carried around. Dean
> suggested added a void* to the pool structure. That is a bit silly as
> that means pools are no longer just memory handling types, but include
> other stuff. The best label to apply for that case is "context".
note if you see my other post about supporting all types of allocation
within one pool you'll see that it'd be cool for the different allocators
to have a void * that they can allocate within the pool...
and as far as usage for the void *, we need some sort of unique identifier
for each user of the pool. ken suggested the module number method, but of
course that doesn't work within APR, because modules are an apache thing.
Dean
Re: Apache using apr.
Posted by Greg Stein <gs...@lyra.org>.
Ryan Bloom wrote:
>...
> My reasons for keeping the contexts. 1) There are enough places inside
> APR where I have to allocate memory, I need some way to do this. 2) Dean
> commented yesterday that there may be situations where we want multiple
> allocation techniques within the same server. By having a context which
> can point to ALL of these techniques at any time, our function prototypes
> are cleaner.
We should use contexts so that the user data can be carried around. Dean
suggested added a void* to the pool structure. That is a bit silly as
that means pools are no longer just memory handling types, but include
other stuff. The best label to apply for that case is "context".
I don't know the merits of including/excluding the user data, but on the
presumption it is a requirement, then we should use "context" as the
primary argument for passing around.
Re: "Why use APR?" -- I totally agree with Dean's long post about why.
Apache needs it, the MPM stuff is orthogonal, and APR may be useful in
the future for other projects (personally, I don't fully recognize the
future benefit of APR for other projects, but even without this, Apache
could use some serious modularization of the platform-specific things).
+1 on keeping APR
+1 on using contexts
Cheers,
-g
--
Greg Stein, http://www.lyra.org/