Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 19789 invoked from network); 10 Oct 2008 12:23:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Oct 2008 12:23:34 -0000 Received: (qmail 34128 invoked by uid 500); 10 Oct 2008 12:23:27 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 34055 invoked by uid 500); 10 Oct 2008 12:23:27 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 34046 invoked by uid 99); 10 Oct 2008 12:23:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 05:23:26 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_SECURITYSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jim@jagunet.com designates 209.133.199.10 as permitted sender) Received: from [209.133.199.10] (HELO jimsys.jaguNET.com) (209.133.199.10) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 12:22:19 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by jimsys.jaguNET.com (Postfix) with ESMTP id 2F8313D2C8D3 for ; Fri, 10 Oct 2008 08:22:55 -0400 (EDT) Message-Id: <75438C5F-3382-4562-A7AB-BF8ABB8643FA@jaguNET.com> From: Jim Jagielski To: dev@httpd.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: PR45605 and event MPM Date: Fri, 10 Oct 2008 08:22:55 -0400 References: <48EBEAB2.1090405@apache.org> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org On Oct 9, 2008, at 4:53 PM, Greg Ames wrote: > > > On Tue, Oct 7, 2008 at 7:03 PM, Ruediger Pluem > wrote: > I am currently looking at PR45605 (https://issues.apache.org/bugzilla/show_bug.cgi?id=45605 > ) > and the analysis and the resulting patch in Comment 4 look good to me > (https://issues.apache.org/bugzilla/show_bug.cgi?id=45605#c4). As > worker and event MPM > are very similar I had a look if and how this patch is applicable to > the event MPM. > I noticed that ap_queue_info_wait_for_idler is quite different in > worker and event MPM. > > I don't think the problem reported by PR45605 exists in the Event MPM. > AFAICT, I don't think so either. > I had to stare at ap_queue_info_wait_for_idler for a long time back > when it could be called by two separate threads. The unserialized > access to queue_info->idlers followed by the unconditional decrement > outside of the mutex in that section of code made my head twitch > when I thought about races on SMP systems. > > The two major improvements in Event's fdqueue are: > > * doing the atomic decrement first before making a decision about > waiting. The decrement is visible to other threads immediately. > * using the negative value of idlers to distinguish between when > threads (just the listener today) are waiting for idle workers vs. > when all workers are busy but nobody else (the listener) is > blocked. That eliminates a situation where the condition variable > is signalled unnecessarily, which happens in the PR scenario. > Comparing the 2, it does appear that Event includes improvements that would benefit Worker and vice versa...