Improving Response times With I/O Completion Ports & Overlapped I/O
Windows NT comes equipped with some special programming features hardly found in other operating systems, that can improve response times in enterprise systems that need to handle large number of transactions. For example an electronic trading system on the Web may be receiving over a thousand messages per second during peak times and distributing computed information or interacting with more than a thousand users at the same time. To handle this kind of information flow in an efficient manner NT provides mechanisms know as I/O Completion ports and Overlapped I/O.
Overlapped I/O is essentially I/O that proceeds mostly in parallel with computation. What this means is that your program can issue an I/O request and instead of sitting there twiddling its thumbs waiting for the operation to complete, it can go ahead with other processing requirements. The I/O operation takes place in parallel. NT will inform the process, if desired, of the completion of the operation through an event or through an I/O completion port. Overlapped I/O thus helps you make better utilization of the CPU, provided the program is well designed to make use of the feature.
I/O completion ports add another dimension to this picture. They allow you to manage a pool of threads efficiently and control the amount of concurrency therein. In a client-server situation where a large number of clients connect to a server, it is not very viable to create a thread for each client, especially so if per-client interactions are not in high volumes or are sporadic. It is often a better method to pre-create a set of threads (a pool) and allocate them to the clients using some ad hoc scheduling scheme. Well, NT makes this very efficient !....




