httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: RFC: Who owns a passed brigade?
Date Fri, 22 Apr 2005 14:32:17 GMT
On Thu, Apr 21, 2005 at 07:05:34PM -0500, Rici Lake wrote:
> 
> On 21-Apr-05, at 5:51 PM, Nick Kew wrote:
> 
> >Rici Lake wrote:
> >
> >>FWIW, I think the (apparent) practice, where the caller relinquishes
> >>ownership of the buckets but not the brigade itself, is more efficient
> >>since it avoids a lot of brigade construction and destruction.
> >
> >Agreed.  And it works for any situation, as either party can do a
> >cleanup to keep resource-use down, and a cleaned up brigade is not
> >too big to wait for pool cleanup.
> 
> "Either party can do a cleanup" does not give either party the 
> responsibility. If neither party did the cleanup, that would be a 
> problem. Lack of clear responsibility is always a problem, and not just 
> with computer programs.

The issue here is really "which party can *destroy* a brigade", right? 
In the current code where brigades are never really destroyed the fact
that apr_brigade_cleanup() is called everywhere is not really harmful,
is it?

It looked to me like it was going to much simpler to adapt filters
shipped in httpd to match the creator-must-destroy model, than to match
a consumer-must-destroy model, despite the ap_pass_brigade docstring. 
It's certainly easier to audit for.

In creator-must-destroy it is still fine for a consumer to call
apr_brigade_cleanup() on a brigade it is passed, of course; that's just
equivalent to consuming all the buckets, after all.

joe

Mime
View raw message