本文主要是介绍I/O 完成端口动态链接库(I/O Completion Port DLL),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
引言
本文的目的是探索windows提供的IO完成端口模型,并比较其他可用等待IO完成的模式。
大型软件经常需要上千个端口连接,如果一个端口对应于一个线程,意味着这些线程的系统花费巨大,IOCP对于“一个线程一个客户”的薄弱问题给予了一种有效的解决方式,用一些运行的线程和异步输入(输出)发送(接收)。 IOCP技术被广泛应用在不同类型的高性能服务器,比如Apache等等。我已经维护lssIocp.dll 两年了,并且我希望我的捐献能对某些人有所帮助。
背景
这是我第一篇文章。我的英语不是十分好,但是我希望得到大家的鼓励。三年前,我需要一个至少能维护5000条连接的高性能服务器,IOCP是最佳解决方案。我在Code Project 的帮助下编写了lssIocp.dll,现在我希望各位能帮我进一步完善它。
代码使用
要使用lssIocp.dll,你需要在你的工程中包含头文件iocpdef.h,并且增加一个名字为InitIocp
的函数。
原文地址:
http://www.codeproject.com/KB/threads/completion_port_dll.aspx
Introduction
The purpose of this article is to explore the IO Completion Port mechanism provided in Windows and compare it with the other mechanisms available to wait for an IO completion.
Large-scale software often needs tens of thousands of socket connections, and if one socket corresponds to one thread, meaning the thread costs the system great expense, IOCP presents an efficient solution to the "one-thread-per-client" bottleneck problem (among others), using only a few processing threads and asynchronous input/output send/receive. The IOCP technology is widely used for different types of high performance servers, such as Apache etc. The lssIocp.dll was something I maintained for two years (IOCP’s storehouse), and I hope my contribution can help somebody.
Background
This is my first article. My English is not very good, but I hoped to obtain everybody's encouragement. Three year’s ago, I needed a high performance server that could maintain 5000 connections at least, and the IOCP was the best solution. I wrote the lssIocp.dll with the help of the Code Project, and now I hope that everybody helps me to further consummate it.
Using the Code
To use lssIocp.dll, you need to include iocpdef.h to your project, and add a function named InitIocp
Collapse Copy Code
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
这篇关于I/O 完成端口动态链接库(I/O Completion Port DLL)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!