Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 23567 invoked by uid 500); 28 Nov 2001 05:57:08 -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 23556 invoked from network); 28 Nov 2001 05:57:07 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Ryan Bloom Reply-To: rbb@covalent.net Organization: Covalent Technologies To: Cliff Woolley Subject: Re: apr_buckets_file.c:file_read + XTHREAD Date: Tue, 27 Nov 2001 22:00:21 -0800 X-Mailer: KMail [version 1.3] Cc: References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20011128060021.975BD46E02@koj.rkbloom.net> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Tuesday 27 November 2001 09:39 pm, Cliff Woolley wrote: > On Tue, 27 Nov 2001, Ryan Bloom wrote: > > Bill's idea was to map and then unmap the individual sections of the > > file, so that no more than one section was mapped at a time. If you > > do that, and you really unmap each section as you map the next, you > > will be thrashing your MMAPs. If you are really going to leave each > > section as an MMAP, then I would agree completely, and say let's do > > it, but that wasn't what Bill suggested. > > It might not be exactly what he said, but I thought it's what he _meant_. > Ahh, don't you love the expressiveness of email? :-) One at a time is > typically what you get with the code I posted anyhow since most filters > limit how much they'll buffer, but the one-at-a-time rule is just not > enforced. If it were enforced, then oh yeah, that would be bad. :) The problem is the pathological case for the content-length filter, where it absolutely REQUIRES a content-length. If you put that filter after the SSI filter, and we map and unmap, you will have problems. While I agree that in the general case mapping and unmapping is fine, I am most concerned about the pathological case that we only hit once every few years, because that is the case that will bite us in the ass. :-) I remember one lesson REALLY well from my time at IBM. I worked next to one of the guys working on the IBM proxy server, and he told me a story about one of the web server developers who had moved on years before. The guy wrote a block of threaded code that had a tiny race condition. He did all of the math, and he found out that in the pathological case, the race condition was thousandths of a second. He theorized that they would never actually see the race condition, so it was safe to leave it in. Wouldn't you know it, the code never got out of QA. When you put any kind of real stress on the server, the race condition was hit. Always worry about the pathological case when you write the code, it will happen at least once. :-) Ryan ______________________________________________________________ Ryan Bloom rbb@apache.org Covalent Technologies rbb@covalent.net --------------------------------------------------------------