From owner-freebsd-net@FreeBSD.ORG Wed Oct 20 20:04:29 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2FCB216A4CE for ; Wed, 20 Oct 2004 20:04:29 +0000 (GMT) Received: from maxwell.syr.edu (maxwell.syr.edu [128.230.129.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9CB143D2D for ; Wed, 20 Oct 2004 20:04:28 +0000 (GMT) (envelope-from cmsedore@maxwell.syr.edu) Received: from exchange.maxwell.syr.edu (excluster2.maxwell.syr.edu [128.230.129.231]) by maxwell.syr.edu (8.12.10/8.9.1) with ESMTP id i9KK4QBf026789; Wed, 20 Oct 2004 16:04:26 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 20 Oct 2004 16:04:27 -0400 Message-ID: <32A8B2CB12BFC84D8D11D872C787AA9A058EE90F@EXCHANGE.forest.maxwell.syr.edu> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: aio_connect ? Thread-Index: AcS23mDylHHulLbjStybFNXDu4AmLAAAZkQw From: "Christopher M. Sedore" To: "Igor Sysoev" , "Ronald F. Guilmette" cc: freebsd-net@freebsd.org Subject: RE: aio_connect ? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2004 20:04:29 -0000 =20 > From: owner-freebsd-net@freebsd.org=20 > [mailto:owner-freebsd-net@freebsd.org] On Behalf Of Igor Sysoev > Subject: Re: aio_connect ? >=20 [...] > While the developing my server nginx, I found the POSIX aio_*=20 > operations > uncomfortable. I do not mean a different programming style, I mean > the aio_read() and aio_write() drawbacks - they have no scatter-gather > capabilities (aio_readv/aio_writev) and they require too many=20 > syscalls. > E.g, the reading requires > *) 3 syscalls for ready data: aio_read(), aio_error(), aio_return() > *) 5 syscalls for non-ready data: aio_read(), aio_error(), > waiting for notification, then aio_error(), aio_return(), > or if timeout occuired - aio_cancel(), aio_error(). >=20 This is why I added aio_waitcomplete(). It reduces both cases to two syscalls. -Chris=20