0
其实最最关键的一点没有想明白,很多地方也并没有说明白。这里我想把我的理解表述一下,希望能够让大家有所启发。

1:上一篇博客中的书中提到:
引用
Applications use WSACreateEvent() to obtain an event object handle which may then be supplied as a
required parameter to the overlapped versions of send and receive calls (WSASend(), WSASendTo(),
WSARecv(), WSARecvFrom()).  The event object, which is cleared when first created, is set by the
transport providers when the associated overlapped I/O operation has completed (either successfully or with
errors). Each event object created by WSACreateEvent() should have a matching WSACloseEvent() to
destroy it.


看来IOCP也是一种事件机制 一个Queue队列管理的事件通知队列
当投递一个WSARecv的时候,只是将其加入Queue队列
当系统处理完该队列的时候 设置该事件的触发
然后GetQueuedCompletionStatus去查询一个事件组 如果发现一个事件完成 就返回
而多个线程通过GetQueuedCompletionStatus去查询这个组 这个事件组应该也是一个锁操作
如果某一个线程处理的时候 其他应该是不可以的
又由于Queue的先进先出原则 可以保证包的顺序


一点点个人理解 大家指点一下

附上早期几个人的讨论文章:
下载文件 (已下载 193 次)
Tags: , | 引用(0)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]