Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 79189 invoked from network); 27 Jun 2006 18:13:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jun 2006 18:13:08 -0000 Received: (qmail 27851 invoked by uid 500); 27 Jun 2006 18:13:06 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 27802 invoked by uid 500); 27 Jun 2006 18:13:06 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 27786 invoked by uid 99); 27 Jun 2006 18:13:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jun 2006 11:13:06 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of chip@force-elite.com designates 216.255.199.145 as permitted sender) Received: from [216.255.199.145] (HELO utopia.in.force-elite.com) (216.255.199.145) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jun 2006 11:13:05 -0700 X-AuthUser: chip@force-elite.com Received: from [127.0.0.1] (127.0.0.1:55258) by localhost with [XMail 1.17 (Linux/Ix86) ESMTP Server] id for from ; Tue, 27 Jun 2006 11:12:42 -0700 Message-ID: <44A17518.9030009@force-elite.com> Date: Tue, 27 Jun 2006 11:12:40 -0700 From: Paul Querna User-Agent: Thunderbird 1.5.0.2 (Macintosh/20060426) MIME-Version: 1.0 To: Mladen Turk CC: APR Developer List Subject: Re: apr_pollset, modifying reqevents References: <44A115B9.80207@apache.org> <44A146CD.3090806@force-elite.com> <44A1653E.9050808@apache.org> In-Reply-To: <44A1653E.9050808@apache.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Mladen Turk wrote: > Paul Querna wrote: >> Mladen Turk wrote: >>> Hi, >>> >>> I propose a new function apr_poll_modify, or >>> modifying apr_poll_add to be able to change >>> the interest ops/events for a designated apr_pollfd_t. >> >> And adding a modify to that API -- since it makes better assumptions >> about the lifetimes of apr_pollfd_t's. I don't think the _modify >> paradigm will be easy to push onto the current apr_pollset API. >> > > I think its not that complicated: > > found = 0 > for (...) > if descriptor part of pollset > found = 1 > > if found > ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_MOD, > descriptor->desc.f->filedes, &ev); > else > ret = epoll_ctl(pollset->epoll_fd, EPOLL_CTL_ADD, > descriptor->desc.f->filedes, &ev); Yeah, but this is an O(n) operation. Suck. With apr_pollcb, it could be an O(1) operation. Maybe its okay to add it to apr_pollset, as long as we document how inefficient it is :) -Paul