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

Mark Geisert mark@maxrnd.com
Tue Apr 3 09:14:00 GMT 2018


Hi Corinna,
I appreciate the update.  I'm about to debug a revised implementation that 
takes into account your most recent comments.  So...

On Tue, 3 Apr 2018, Corinna Vinschen wrote:
> Hi Mark,
>
> On Mar 28 22:57, Mark Geisert wrote:
>> Corinna Vinschen wrote:
>>> On Mar 19 22:53, Mark Geisert wrote:
>>>> 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.
>>>
>>> That's definitely ok.  When I was talking about pread/pwrite in our
>>> preliminary discussion on cygwin-patches, I was always talking about the
>>> fhandler_disk_file::pread and fhandler_disk_file::pwrite methods in
>>> fact, not the syscalls of the same name.  I'm sorry I was unclear there :}
>> [...]
>>> Looks like you're on the right track, just go ahead.  We can fix the
>>> finer details later.
>>
>> OK, I've posted a 3-part patch set to cygwin-patches.  This is still a WIP
>> so it doesn't yet include what's been decided above.  It currently queues
>> async ops to cygthread worker threads.
>>
>> I plan to update aio_read() and aio_write() to try to launch async ops
>> inline, and only if they fail with ESPIPE would they be queued for worker
>> thread action.  (E.g., ops on sockets or other devices without pread/pwrite
>> support.)
>>
>> I think parts 1 and 2 of the patch set are essentially finished, unless
>> there are issues to be corrected.  But part 3 will need some more work done.
>> Thanks,
>
> Thank you!  I'm a bit low on available time ATM so please be patient.
> I'll check your patch as time permits.

No worries.  Take the "part 3" patch with a large grain of salt if/when 
you get to it.

> A word in terms of your commit messages.  Just providing the fact in the
> commit header is a bit low on details.  Don't be shy to improve your
> commit messages with some details, what you did, why you did it, what to
> look for.

Yes, absolutely.  I neglected to say what each patch part does.  I seem to 
be stumbling over every patch posting convention one by one :-?.  Onward!

> Some testcase (here on cygwin-developers, not as patch) would be
> nice, too.

I do have a couple already.  One is a (fairly large) test app I have that 
times various methods of copying the heap from one process to a child. 
AIO is one of those methods.  I could whittle that down to something 
using only AIO.  And the Linux man page for aio(7) has a sample program 
that can test AIO on something other than disk files.
Thanks & Regards,

..mark



More information about the Cygwin-developers mailing list