摘要: TerminateThreadis a dangerous function that should only be used in the most extreme cases. You should callTerminateThreadonly if you know exactly what the target thread is doing, and you control all of the code that the target thread could possibly be running at the time of the termination. For exam 阅读全文
posted @ 2012-11-06 18:09 小 楼 一 夜 听 春 雨 阅读(3897) 评论(0) 推荐(0)
摘要: from:http://blog.csdn.net/fatacy/article/details/16230451.避免了select的查询,可以从socket直接定位到完成端口。想象同时上千个连接的程序中,别的模型里只能通过select的方式对所有的socket链接查询一次才能知道哪个socket上有事件;而完成端口模型中,一旦一个socket上有事件发生,它立即将事件组成一个完成包放入完成端口(实际上是个队列,放入完成端口的内部API是KeInsertQueue),这时等待线程直接从中取出该事件,如此即避免了一次查询。2.相对一个链接一个线程的模型,避免了大量线程切换,能够最大限度的利用C 阅读全文
posted @ 2012-11-06 18:00 小 楼 一 夜 听 春 雨 阅读(1015) 评论(0) 推荐(0)