From owner-freebsd-hackers Wed Apr 21 19:28: 3 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mailer.syr.edu (mailer.syr.edu [128.230.18.29]) by hub.freebsd.org (Postfix) with ESMTP id 8E43415905 for ; Wed, 21 Apr 1999 19:27:50 -0700 (PDT) (envelope-from cmsedore@mailbox.syr.edu) Received: from rodan.syr.edu by mailer.syr.edu (LSMTP for Windows NT v1.1a) with SMTP id <0.DA2D3360@mailer.syr.edu>; Wed, 21 Apr 1999 22:25:25 -0400 Received: from localhost (cmsedore@localhost) by rodan.syr.edu (8.8.7/8.8.7) with SMTP id WAA08004 for ; Wed, 21 Apr 1999 22:25:19 -0400 (EDT) X-Authentication-Warning: rodan.syr.edu: cmsedore owned process doing -bs Date: Wed, 21 Apr 1999 22:25:18 -0400 (EDT) From: Christopher Sedore X-Sender: cmsedore@rodan.syr.edu To: hackers@freebsd.org Subject: aio_suspend() functionality Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I sent a message a day or two ago asking if anyone had looked into changing the behavior of aio_suspend so that it did not require a list of aiocb's, but rather would accept an array of null pointers, and then fill them in for you when an operation completed. A patch to vfs_aio.c that does just this is available at ftp://ftp.maxwell.syr.edu/freebsd/vfs_aio.c-aio_suspend-patch Why would one care about this? If one were going to have hundreds (or thousands) of outstanding asynchronous IO requests, it isn't very efficient to handle them buy building arrays of pointers to control blocks and then polling each one to determine whether or not it has completed, particularly since the kernel already has them in a handy list. It essentially allows you to use aiocb's as fire and forget: malloc one (possibly "growing it" to keep your own state), give it to the OS with aio_read/aio_write, then simply poll for completed events using aio_suspend. When an operation completes, you'll get the pointer to the aiocb back. This patch is against FreeBSD 3.1-STABLE It works in my testing, and is not entirely backwardly compatible with the old aio_suspend (it won't behave the same way if you pass in an array of all NULL pointers, otherwise it should be functionally equivalent). The patch will generate a warning during compiling because the upper layers pointing to aio_suspend expect the array of pointers to be a const, and I deconstify it. -Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message