Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Dec 1997 01:32:08 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        toor@dyson.iquest.net (John S. Dyson)
Cc:        current@FreeBSD.ORG
Subject:   Re: FYI: usage of new AIO calls
Message-ID:  <199712020132.SAA28471@usr07.primenet.com>
In-Reply-To: <199712011926.OAA00376@dyson.iquest.net> from "John S. Dyson" at Dec 1, 97 02:26:34 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> For fun (and actually as a result of a comment by Justin Gibbs), I have put
> together a small program that could maybe be used for streaming tape drives
> using the new AIO code.  Note that if you try this, it must be used only
> on current kernels on/after 19:00 GMT, Dec 1.

[ ... ]

> errval = aio_suspend(&olist[i], 1, NULL);
> errval = aio_error(olist[i]);
> rtval = aio_return(olist[i]);
> errval = aio_write(olist[i]);
> nread = read( fd1, bufaddrs[i], BUFSZ);

Some questions...

1)	Why did you 'read' instead of 'aio_read'?

2)	Why did you define your own interface instead of using the
	SunOS/Solaris/SVR4/SCO interface:

	--------------------------------------------------------------
	#include <sys/asynch.h>

	int aioread(fd, bufp, bufs, offset, whence, resultp)
	int fd;
	char *bufp;
	int bufs;
	int offset;
	int whence;
	aio_result_t *resultp;

	int aiowrite(fd, bufp, bufs, offset, whence, resultp)
	int fd;
	char *bufp;
	int bufs;
	int offset;
	int whence;
	aio_result_t *resultp;

	--------------------------------------------------------------

	#include <sys/asynch.h>
	#include <sys/time.h>

	aio_result_t *aiowait(timeout)
	struct timeval *timeout;

	--------------------------------------------------------------

	#include <sys/asynch.h>

	int aiocancel(resultp)
	aio_result_t *resultp;

	--------------------------------------------------------------

	Is there a reason for this incompatability?  You are aware
	that there exist many programs for which we should like to
	provide ABI compatability that directly reference these calls,
	including the library code from the University of Washington
	paper "User Space Threading And SPARC Register Windows" ...
	AKA SunOS 4.1.3 liblwp, right?

3)	Do you plan on adding the compatability header file and
	compatability system calls?


Not to rain on anyone's parade, but I sort of just assumed that any
"AIO" implementation that was implemented as other than a generalized
async call gate mechanism (so that a cooperative kernel/user threading
scheduler could be built) would be implemented as a compatability API
for exising AIO mechanisms, and not some new invention.  8-(.  Pretty
cleary, the new invention (just like Sun's invention) is less than
useful for socket I/O that needs to consider OOB data.  Like the Telnet
protocol used on the control connection to an FTP server.

I like the idea of adding list-based mechanisms, but at the very
least, the API consumed by existing software should probably be
supported (and probably not as wrappers, both for ABI and for
non-list-based performance considerations).  For example, can't
pthreads from the MIT distribution use aio instead of select()
based "readability/writeability" testing for a significant performance
win?


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712020132.SAA28471>