httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodent of Unusual Size <Ken.C...@Golux.Com>
Subject Re: Context types in APR.
Date Fri, 07 May 1999 20:27:29 GMT
Ben Hyde wrote:
>                             This would imply that all objects created
> by APR have a pool, and a slot for user properties, i've no problem
> with that.

I like that.

> Would you rather write:
>       ap_palloc(cntx, p, sizeof(foo))
>    or ap_palloc(p, sizeof(foo))
> for the next decade?

I'd rather call ap_palloc(cntx, sizeof(foo)).  I've been labouring
under the assumption that it was clear that a context includes
a pool.

> >    I fail to see
> > why pools *must* be associated with one and only one thread;
> > I maintain that they are separate, not subordinate.
> To avoid having ap_palloc pay the cost of getting a lock on
> every allocation.  So they have to "reside" in a thread by
> default.

Feh.  If you have a pool subordinate to a thread object,
note the fact that synchronisation isn't necessary.  Store
that note in either the pool structure or the context structure
when it's created.  (Hey, that's not a bad idea in general..)
For pools that aren't 'part of' a thread, leave the bit clear.
#ken    P-)}

Ken Coar                    <http://Web.Golux.Com/coar/>
Apache Software Foundation  <>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>

View raw message