Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 5237 invoked by uid 500); 17 May 2001 18:29:04 -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 4897 invoked from network); 17 May 2001 18:28:59 -0000 Date: Thu, 17 May 2001 11:28:34 -0700 From: Justin Erenkrantz To: David Reid Cc: APR Development List Subject: Re: Pools & locking? Message-ID: <20010517112834.M23812@ebuilt.com> References: <00a601c0deea$f5b865b0$71ac70d8@VAIO> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <00a601c0deea$f5b865b0$71ac70d8@VAIO>; from dreid@jetnet.co.uk on Thu, May 17, 2001 at 05:03:29PM +0100 X-AntiVirus: scanned for viruses by AMaViS 0.2.1-pre3 (http://amavis.org/) X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Thu, May 17, 2001 at 05:03:29PM +0100, David Reid wrote: > Did we ever do anything about the locking issue that Justin (ISTR) threw up > when we build apr using threads? ISTR some emails but wasn't sure we ever > actually fixed it, hence the question... Basically, Roy pointed out that we are attempting to lock pools that are inherently only part of a request (and only part of one thread). So, if APR_HAS_THREADS is enabled, each allocation from the request_rec pool will (for all but the most brain dumb *threaded* MPMs) receive its own apr_pool_t and thread. So, there won't be the possibility for contention in the common case. However, APR assumes that when APR_HAS_THREADS is defined that any allocation must be mutually exclusive. This will just be pointless overhead, since the pools are already isolated for one request. There should be some case to prevent acquiring and releasing locks in the apr_pool_t when the caller can guarantee that we have no possible contention (or if contention occurs, it's the caller's fault). IMHO, this is a mismatch between APR and httpd-2.0. I'm not sure of the best way to resolve this. But, the apr_sms_t stuff gives us an opportunity to address this (if we can). -- justin