Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 69311 invoked from network); 21 Apr 2005 15:57:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Apr 2005 15:57:57 -0000 Received: (qmail 35323 invoked by uid 500); 21 Apr 2005 15:58:10 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 35263 invoked by uid 500); 21 Apr 2005 15:58:09 -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 35231 invoked by uid 99); 21 Apr 2005 15:58:09 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from i.meepzor.com (HELO Boron.MeepZor.Com) (204.146.167.214) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 21 Apr 2005 08:58:08 -0700 Received: from [127.0.0.1] (dmz-firewall [206.199.198.4]) by Boron.MeepZor.Com (8.12.8/8.12.8) with ESMTP id j3LFvmaD002809 for ; Thu, 21 Apr 2005 11:57:51 -0400 Message-ID: <4267CD7C.7000304@wstoddard.com> Date: Thu, 21 Apr 2005 11:57:48 -0400 From: Bill Stoddard User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@apr.apache.org Subject: Re: [WIN32] alternative apr_pollset implementation proposal References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N James Mansion wrote: >>IOCPs support true async network i/o. BSD KQ, Solaris /dev/poll, epoll et. > > al. are not async, they are event > >>driven i/o models. When you issue an async read on Windows, the kernel will > > start filling your i/o buffer as > >>soon as data is available. > > > I'm not sure the technique you describe will work. > > Consider an alternative approach: > > 1) from a poll perspective, consider a socket that does not have an > overlapped operation in progress as ready for writing. Write to a buffer > that's owned by the poller and then run the overlapped or IOCP from that. > > 2) for reading, always have an OVERLAPPED operation running against a > poll-owned buffer - unless the read side has been shutdown or we're not yet > connected. If this buffer is not empty, poll considers it readable. > > Extra buffer copies are needed but it does the job. We're just using a > buffer/queue to translate between push and pull structures, after all. > > James I like this approach and we can probably work out how to do reads w/o introducing an additional buffer copy. The buffers would get morphed into immortal buffer types and ownership of the buffer would be passed to the polling (or worker?) thread. Bill