admin管理员组文章数量:1334671
I have two questions regarding Windows IOCP (I/O Completion Ports) and Overlapped I/O:
1. Order of Asynchronous I/O Operations: In Jeffrey Richter's book Windows Via C/C++, the following statement is made:
"You should be aware of a couple of issues when performing asynchronous I/O. First, the device driver doesn't have to process queued I/O requests in a first-in first-out (FIFO) fashion."
This implies that when calling Overlapped I/O functions, the operations might not be processed in the order they were initiated. Here's an example:
// part of iocp tcp server
WSASend( ... ); // 1
WSASend( ... ); // 2
WSASend( ... ); // 3
Is Windows allowed to process the WSASend
calls out of the order in which they were called? However, since TCP inherently guarantees message order, how is message sequencing ensured when using Overlapped I/O functions?
2. Completion Notification Order in IOCP: It's mentioned that in IOCP model servers, completion notifications might not arrive in the order the I/O was initiated. However, in my experience with IOCP servers, I've never encountered out-of-order message delivery.
- Why doesn't the completion notification order guarantee the sequence of operations?
- If the completion notifications are not in order, how is the message order still maintained?
I appreciate any insights or explanations that could help clarify these points!
版权声明:本文标题:c++ - Understanding Windows IOCP and Overlapped IO: Order of Completion and Message Sequencing - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742378027a2463554.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论