[asio] File AIO(win32) and "Overlapped I/O operation is in progress" error

Hi, I'm implementing file AIO in asio for windows. I've tried to use as much as possible from asio. The problem is that when reading bigger files (more than one megabyte), the queue returns an error: code 997, that is converted to "Overlapped I/O operation is in progress." When that happens, the asio deletes the handler, but the operation is still happening, so GetQueuedCompletionStatus returns one more time for the same overlapped with the completed IO, but the handler is already deleted. This happens in: handler_operation::do_completion_impl (win_iocp_demuxer_service:169) It holds a std::auto_ptr to the handler, but has no access to the error code. So I cant see how to correct this. I think that socket AIO could return this too (specially in ConnectEx, I've seen this in my own "raw AIO" code). I havent finished the file aio yet, when it gets a little better I'll publish here (probably this weekend). Thanks, -- Felipe Magno de Almeida

Sorry, I found the problem. I writed the async_read to use ReadFileEx, that doesnt return an error when making an asynchrnous call, then later I changed to ReadFile and the error started. -- Felipe Magno de Almeida

Felipe Magno de Almeida wrote:
Hi,
...
I havent finished the file aio yet, when it gets a little better I'll publish here (probably this weekend).
Please do! Is your intent that file aio and asio operations can share the same demuxer? Thanks, Jeff

On 3/27/06, Jeff Flinn <TriumphSprint2000@hotmail.com> wrote:
Felipe Magno de Almeida wrote:
Hi,
...
I havent finished the file aio yet, when it gets a little better I'll publish here (probably this weekend).
Please do! Is your intent that file aio and asio operations can share the same demuxer?
Yes, in what I have already this is possible (but it is in Windows, in Linux I dont think that would be possible though, since it would have to use an AIO demuxer).
Thanks, Jeff
-- Felipe Magno de Almeida
participants (2)
-
Felipe Magno de Almeida
-
Jeff Flinn