Network Programming with IOCP and Thread Pool – Intro
来源:互联网 发布:整形网络平台 编辑:程序博客网 时间:2024/05/16 20:29
http://www.youngwriting.net
http://www.youngwriting.net/blog/?paged=14
These days, I’m playing with network programming with IOCP and Thread Pool just for pure fun. :) After several days of reading MSDN, articles and writing experimental codes, I’ve realized that there are pretty big changes I need to catch up.
If you still use IOCP with GetQueuedCompletionStatus() and your custom threads (like me before), you might want to follow this series of postings I will update. I will provide sample code to clarify the right way to use them.
Also, I will benchmark techniques to each other so that hopefully I can give you some guidelines about When we need to use Which technique, or, at least, help you to avoid making the same mistakes I would make while I write this series.
First of all, let’s see how many ways we can choose for using IOCP.
If we use custom threads to get I/O completion notification,
1. CreateIoCompletionPort() and GetQueuedCompletionStatus()
- Windows 2000 (Pro, Server) or later.
2. CreateIoCompletionPort() and GetQueuedCompletionStatusEx()
- Windows Vista and Server 2008 or later.
If we use Windows Thread Pool to get I/O completion notification,
3. BindIoCompletionCallback()
- Windows 2000 (Pro, Server) or later.
4. CreateThreadpoolIo(), StartThreadpoolIo() and etc
- Windows Vista and Server 2008 or later.
There also some APIs related to Thread Pool like QueueUserWorkItem(). Unfortunately, but in a good way, Thread Pool system has been completely re-written for Windows Vista and we need to use those new and richer APIs to maximize our server performance.
If it’s not confusing enough, I can tell you that there are also special socket functions which are Microsoft-specific extensions to the Windows Sockets specification. For example, ConnectEx(), AcceptEx() and etc. These functions are to fully utilize IOCP power for all IO operations including receive (read) and send (write).
Yes, it’s gonna be a long journey but it must be fun! So excited! LOL
- Network Programming with IOCP and Thread Pool – Intro
- [Computer and Network Security] Programming with OpenSSL
- Linux Network Programming Intro - Dual Network Card
- 下载:Network programming.NET with C# and VB.NET 2004
- thread pool and database connection pool
- Intro to Filtering with Network Monitor 3.0
- IOCP Thread Pool 在 C# 的Safe实现
- Android Dev Intro - Thread Looper and Handler
- Improve Scalability With New Thread Pool APIs
- Improve Scalability With New Thread Pool APIs
- Multiplayer and Network Programming (zz)
- FAQ - Multiplayer and Network Programming
- C++ Network Programming, Vol. 1: Mastering Complexity with ACE and Patterns
- C++ Network Programming, Volume 2: Systematic Reuse with ACE and Frameworks
- Thread Pool and Asynch I/O
- How to: Use a Thread Pool (C# Programming Guide)
- Programming the Thread Pool in the .NET Framework
- KMThreadPool: 5 – Thread Pool Step 3:Enter Thread Pool
- 异步动作处理类---典型的生产者消费者模型
- 程序员杂志2009精华版摘要——项目管理面试百问
- AIX Oracle RAC 升级到10.2.0.4.0要特别注意的问题
- 程序员杂志2009精华版摘要——项目管理价值观
- 恢复ubuntu启动项
- Network Programming with IOCP and Thread Pool – Intro
- 用strlen()时的粗心
- 程序人生 : 30岁,我的程序员梦想
- 放松自己及其方式
- Upgrade Oracle 9i RAC to Oracle 10g RAC
- java字符串移动插入
- 程序员杂志2009精华版摘要——项目管理文化
- [转载]SQL Server 2005 Data Mining简介
- Improve Scalability With New Thread Pool APIs