From owner-freebsd-net@FreeBSD.ORG Wed Oct 20 20:27:54 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 770BA16A4CE for ; Wed, 20 Oct 2004 20:27:54 +0000 (GMT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA3B443D1D for ; Wed, 20 Oct 2004 20:27:53 +0000 (GMT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id i9KKRqis058928; Thu, 21 Oct 2004 00:27:52 +0400 (MSD) (envelope-from is@rambler-co.ru) Date: Thu, 21 Oct 2004 00:27:52 +0400 (MSD) From: Igor Sysoev X-X-Sender: is@is.park.rambler.ru To: "Christopher M. Sedore" In-Reply-To: <32A8B2CB12BFC84D8D11D872C787AA9A058EE90F@EXCHANGE.forest.maxwell.syr.edu> Message-ID: <20041021001251.G17688@is.park.rambler.ru> References: <32A8B2CB12BFC84D8D11D872C787AA9A058EE90F@EXCHANGE.forest.maxwell.syr.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org cc: "Ronald F. Guilmette" 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:27:54 -0000 On Wed, 20 Oct 2004, Christopher M. Sedore wrote: > > While the developing my server nginx, I found the POSIX aio_* > > 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 > > 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(). > > This is why I added aio_waitcomplete(). It reduces both cases to two > syscalls. As I understand aio_waitcomplete() returns aiocb of any complete AIO operation but I need to know the state of the exact AIO, namely the last aio_read(). I use kqueue to get AIO notifications. If AIO operation would fail at the start, will kqueue return notificaiton about this operation ? Igor Sysoev http://sysoev.ru/en/