游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1966|回复: 2

请教IOCP问题

[复制链接]

17

主题

25

帖子

33

积分

注册会员

Rank: 2

积分
33
发表于 2008-10-29 16:41:00 | 显示全部楼层 |阅读模式
我用一个线程打开IOCP通信
        BOOL isSuccess = GetQueuedCompletionStatus( completionPort, &bytesTransferred,
                        &completionKey, &overlapped, timeout );
请问最后一个参数设置了INFINITE等待,也就是timeout 为INFINITE

我想关闭这个线程了,但是我无法激活GetQueuedCompletionStatus,在没有连接通信的情况
关闭这个线程我用了强制 关闭。

请问,能唤醒GetQueuedCompletionStatus吗?
这样我那个线程就可以不用强制关闭了。

谢谢

2

主题

79

帖子

85

积分

注册会员

Rank: 2

积分
85
QQ
发表于 2008-10-31 10:27:00 | 显示全部楼层

Re: 请教IOCP问题

You can call the PostQueuedCompletionStatus function to post an I/O completion packet to an I/O completion port. The I/O completion packet will satisfy an outstanding call to the GetQueuedCompletionStatus function.

6

主题

307

帖子

309

积分

中级会员

Rank: 3Rank: 3

积分
309
发表于 2008-11-2 11:52:00 | 显示全部楼层

Re:请教IOCP问题

不要使用INFINITE,可以用1或者更长,保证线程的活动性就不会关不掉了

不用担心性能的损失,微乎其微
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-21 00:30

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表