Re: I/O completion ports for Linux

Robey Pointer (robey@lag.net)
Sat, 04 Apr 1998 16:27:10 -0800


Alan Cox wrote:
>
> > Well, I have to admit that I cheated a bit on the "async" part. The
> > current patch just does the read/write in the context of one of the
> > tasks that's blocking on the completion-port read. Without anyone
>
> Most people cheat. The folks who did the original Posix AIO ended up using
> the equivalent of clone() and kernel reliable signals to perform
> the operation. Linux can create a clone() so fast its not a performance
> problem.

In that case, we could have a kernel syscall entry point for
aio_read/aio_write which actually accept the operation request *and the
fd of an IOCP to notify*. These special calls would just queue one
request without changing the status of the fd (ie, whether or not that
fd was associated with an IOCP already). The way I do IOCP currently,
this would be trivial. libc (or any other library) could implement
posix AIO like this:

* On the first AIO attempt, libc opens a special IOCP for
posix AIO, and clone()'s a thread which does nothing but
block on an IOCP read()
* For every AIO call, it calls the syscall aio_read/write
with the fd of the IOCP
* The AIO thread catches the completed I/O and sends the
proper signal to the thread.

Do you think that would work? (cc:ing linux-kernel)

Robey

-- 
Robey Pointer              |  "So that's what an invisible barrier
robey@lag.net              |   looks like."   -Time Bandits
http://www.lag.net/~robey  |  (join the 90's retro bandwagon early!)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu