On Dec 1 13:46, Mark Geisert wrote:
I'm open to using overlapped I/O for the usual read & write cases of aio but
there are some extensions I have in mind that don't allow for overlapped so
I think I need to have threads handle them. I might combine the two.
I'm just a bit concerned in terms of calling lots of aio_read/write at
the same time or lio_listio with lots of entries. One thread for each
entry?
Using
overlapped for the common case would, I think, allow me to reduce the number
of worker threads hanging around. Thanks for the input!
I wonder if APCs are the way to go for this use case. As you might
know, Nt{Read,Write}File provide a way to specify an APC routine and a
APC context pointer (struct aiocb *?), so instead of waiting actively
for the event, you could just lean back and wait for the APC routine to
be called.
As a sidenote, I think we could use APCs in other scenarios, too, but
somehow we never got around to it.