Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 10978 invoked by uid 500); 4 Sep 2001 01:49:49 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 10967 invoked from network); 4 Sep 2001 01:49:48 -0000 X-Authentication-Warning: cobra.cs.Virginia.EDU: jcw5q owned process doing -bs Date: Mon, 3 Sep 2001 21:49:52 -0400 (EDT) From: Cliff Woolley X-X-Sender: To: Ryan Bloom cc: Subject: Re: [PATCH] buckets sms phase 2 In-Reply-To: <20010904005913.5957D46993@koj.rkbloom.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Mon, 3 Sep 2001, Ryan Bloom wrote: > I seriously dislike adding an SMS to every bucket. I believe we are > much better off just creating a per-thread free bucket list. That > keeps us from ever calling free while dealing with a request, and over > time, we will stop calling malloc. Okay, let's examine this option for a minute. There are two ways to do this: either the buckets code handles it or httpd handles it. If the buckets code handles it, you have to do the thread lookups we talked about before, which is bad. So that pretty much means it's up to the httpd to handle it. So what's the easiest way to do that? You can have a list of apr_bucket's that can be reused easily enough--sort of. Once you grab your apr_bucket struct, what do you do with it? You'd have to rewrite the copy/split functions for all bucket types, because none of them support an already-created apr_bucket. Or you could add a copy_into and split_into to the bucket API that take a pre-allocated apr_bucket as a parameter. You'd also have to wrap the make functions of all bucket types to replace the built-in create functions. That's even harder than the copy/split functions, because the create functions for the different bucket types all have different prototypes. So you'd pretty much have to add a create_into function for all bucket types. Then there's the problem of the private data structures... you're pretty much SOL there, unless you rewrite all of the make functions as well and have a make_into for each one that takes some pre-allocated hunk o' memory as a parameter (and hope it's big enough--how can the httpd ever know how much memory a given bucket type requires?). Other than that, you're stuck letting the make functions keep on using malloc, which is on a guess 45-50% of the malloc calls that would remain. So what we've ended up with is that we've almost doubled the size of the bucket API so that the httpd can do the free-list work. Are we even on the same wavelength? Is this in fact what you had in mind? If not, what? --Cliff -------------------------------------------------------------- Cliff Woolley cliffwoolley@yahoo.com Charlottesville, VA