Questions tagged [io-completion-ports]

Input/Output Completion Port (I/O Completion Ports, or IOCP) is an API for performing multiple simultaneous asynchronous input/output operations in Windows, AIX and Solaris.

Input/Output Completion Port (IOCP) is an API for performing multiple simultaneous asynchronous input/output operations in Windows (NT versions 3.5 and later), AIX and on Solaris (version 10 and later).

An input/output completion port object is created and associated with a number of sockets or file handles. When I/O services are requested on the object, completion is indicated by a message queued to the I/O completion port. A process requesting I/O services is not notified of completion of the I/O services, but instead checks the I/O completion port's message queue to determine the status of its I/O requests. The I/O completion port manages multiple threads and their concurrency.

More information is available on MSDN for Windows and on IBM website for AIX.

76 questions
79
votes
1 answer

What's the difference between epoll, poll, threadpool?

Could someone explain what the difference is between epoll, poll and threadpool? What are the pros / cons? Any suggestions for frameworks? Any suggestions for simple/basic tutorials? It seems that epoll and poll are Linux-specific... Is there an…
Filly
  • 1,341
  • 3
  • 11
  • 7
47
votes
3 answers

.NET sockets vs C++ sockets at high performance

My question is to settle an argument with my co-workers on C++ vs C#. We have implemented a server that receives a large amount of UDP streams. This server was developed in C++ using asynchronous sockets and overlapped I/O using completion ports. …
mdarsigny
  • 607
  • 1
  • 6
  • 9
23
votes
6 answers

Win32 Overlapped I/O - Completion routines or WaitForMultipleObjects?

I'm wondering which approach is faster and why ? While writing a Win32 server I have read a lot about the Completion Ports and the Overlapped I/O, but I have not read anything to suggest which set of API's yields the best results in the…
james
13
votes
2 answers

C# async/await chaining with ConfigureAwait(false)

Based on numerous books and blogs including this excellent one here, it is clear that when one writes a dll library exposing helper async methods i.e. the wrapper methods, it is generally considered a best practice to internally complete the I/O…
SamDevx
  • 2,268
  • 4
  • 32
  • 47
7
votes
3 answers

CloseHandle() returns before the serial port is actually closed

I'm pulling my hair trying to figure out when a serial port finishes closing so I can reopen it. It turns out that CloseHandle() returns before the port is actually unlocked. I am opening a serial port using CreateFile(FILE_FLAG_OVERLAPPED),…
Gili
  • 86,244
  • 97
  • 390
  • 689
6
votes
0 answers

Why CompletionKey in I/O completion port?

Remark from MSDN about CompletionKey in CreateIoCompletionPort function: Use the CompletionKey parameter to help your application track which I/O operations have completed. This value is not used by CreateIoCompletionPort for functional…
Y.Z
  • 626
  • 2
  • 9
  • 21
6
votes
2 answers

Intermittently no data delivered through boost::asio / io completion port

Problem I am using boost::asio for a project where two processes on the same machine communicate using TCP/IP. One generates data to be read by the other, but I am encountering a problem where intermittently no data is being sent through the…
villintehaspam
  • 8,540
  • 6
  • 45
  • 76
6
votes
3 answers

HttpWebRequest and I/O completion ports

I'm working on an application that requires for one type of message to go hit a database, and the other type of message to go and hit some external xml api. I have to process A LOT... one of the big challenges is to get HttpWebRequest class…
peteisace
  • 2,754
  • 1
  • 19
  • 19
6
votes
1 answer

SocketAsyncEventArgs buffer is full of zeroes

I'm writing a message layer for my distributed system. I'm using IOCP, ie the Socket.XXXAsync methods. Here's something pretty close to what I'm doing (in fact, my receive function is based on…
Carlos
  • 5,991
  • 6
  • 43
  • 82
5
votes
2 answers

When are IO completion port packets sent and when not?

I'm currently working on an IPC mechanism based on named pipes using a IO completion port. Unfortunately I have some troubles with the msdn documentation because it's quite unclear to me in which cases calls to ReadFile/WriteFile result in a…
5
votes
1 answer

Asynchronous action methods and IO completion ports

One of the reasons why it is important to use asynchronous programming when our application relies on external services, is to allow ASP.NET the use of IO completion ports, so rather than block a thread waiting for the external service to respond,…
5
votes
1 answer

I/O Completion Ports vs. RegisterWaitForSingleObject?

What's the difference between using I/O completion ports, versus just using RegisterWaitForSingleObject to have a thread pool thread wait for I/O to complete? Is one of them faster, and if so, why?
user541686
  • 205,094
  • 128
  • 528
  • 886
4
votes
2 answers

How to detect WinSock TCP timeout with BindIoCompletionCallback

I am building a Visual C++ WinSock TCP server using BindIoCompletionCallback, it works fine receiving and sending data, but I can't find a good way to detect timeout: SetSockOpt/SO_RCVTIMEO/SO_SNDTIMEO has no effect on nonblocking sockets, if the…
WalkingCat
  • 263
  • 3
  • 10
4
votes
2 answers

c# parallel IO Completion Ports

I'm trying to figure out the best way to wait for some number of I/O Completion ports to complete. For this scenario, let's say that I'm in a MVC3 web app. (My understanding is the use of I/O Completion ports here is recommended so I can return the…
Adam Tegen
  • 25,378
  • 33
  • 125
  • 153
4
votes
2 answers

Resources To learn IOCP On Windows

I recently was made aware of this thing called IOCP on windows and i began searching for more information on it but i couldn't find anything up to date (most of the examples were on codeproject almost 5 years old) and not too many guides or…
BRampersad
  • 862
  • 1
  • 12
  • 25
1
2 3 4 5 6