Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 18055 invoked from network); 9 Jul 2009 01:11:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Jul 2009 01:11:24 -0000 Received: (qmail 1422 invoked by uid 500); 9 Jul 2009 01:11:33 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 1333 invoked by uid 500); 9 Jul 2009 01:11:32 -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 1324 invoked by uid 99); 9 Jul 2009 01:11:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jul 2009 01:11:32 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bojan@rexursive.com designates 150.101.121.179 as permitted sender) Received: from [150.101.121.179] (HELO beauty.rexursive.com) (150.101.121.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jul 2009 01:11:23 +0000 Received: from [10.1.120.24] (shrek.rexursive.com [10.1.120.24]) by beauty.rexursive.com (Postfix) with ESMTP id 769268C0AA for ; Thu, 9 Jul 2009 11:11:00 +1000 (EST) Subject: Re: Events, Destruction and Locking From: Bojan Smojver To: dev@httpd.apache.org In-Reply-To: <1247014865.2811.309.camel@shrek.rexursive.com> References: <4239a4320907062220k21987b38uebbd3e7b1c7f0f37@mail.gmail.com> <4A5332CD.5050101@sharp.fm> <4239a4320907070514q286b87bbx2646ed5fb7e279ab@mail.gmail.com> <4A5341E7.9080801@sharp.fm> <4239a4320907070639xf953b6u4905514e98c0dee8@mail.gmail.com> <4A535534.5080906@sharp.fm> <1247014865.2811.309.camel@shrek.rexursive.com> Content-Type: text/plain Date: Thu, 09 Jul 2009 11:11:00 +1000 Message-Id: <1247101860.2811.315.camel@shrek.rexursive.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 (2.26.2-1.fc11) Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On Wed, 2009-07-08 at 11:01 +1000, Bojan Smojver wrote: > So, the loop would be: > > - poll() > - try assembling a full request from data read so far > - process if successful > - go back to poll() if not > > Too naive? I see that we'd most likely get stuck with the accept mutex (i.e. if another process had it, we would not be poll()-ing already accepted fds any more). We could work around this by using apr_proc_mutex_trylock() if there are any already accepted fds. If this fails, we just poll() already accepted fds (i.e. someone is already poll()-ing to accept()). Otherwise, we poll() the lot. -- Bojan