This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implementing aio_* and lio_* (async i/o) on Cygwin


Corinna Vinschen wrote (a while back):
However, using async IO, the only change necessary would be to change
prw_open to open an async handle, and pread/pwrite to wait for the
result if the current I/O is NOT async.  It may be necessary to add a
parameter or two to the pread/pwrite fhandler methods, but all the rest
of the functionality could be in the callers.

I see what you're suggesting; seems sly in a nice way :).

A small part I'm missing is in interfacing to the layer above this. Are the aio_* functions supposed to be implemented as "real" syscalls (in syscalls.cc)? Or should they be implemented in their own aio.cc (which is where I have them ATM) and call pread()/pwrite() to do their dirty work? I'm unsure how "central" a syscall has to be to merit syscalls.cc location.

Regardless of which file the code is in, I was thinking I should copy syscalls.cc's pread() contents into aio_read(), for example, to start with. Then add extra param(s) as needed to the fhandler method call as you suggested.

The problem with having aio_read() call pread() directly is how to tell pread() we want an async read. That's why I was suggesting O_ASYNC previously, though I now understand that's the wrong direction to go. What is the correct direction?
Thanks much,

..mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]