Questions tagged [iocp]

An I/O Completion Port (IOCP) provides a way to execute asynchronous I/O operations efficiently on Windows.

An I/O Completion Port (IOCP) provides a way to execute asynchronous I/O operations efficiently on Windows.

It can be used by the native CreateIoCompletionPort() function. It's also used internally by some of the types that use the Begin*-End* asynchronous programming model in .Net.

350 questions
82
votes
4 answers

Simple description of worker and I/O threads in .NET

It's very hard to find detailed but simple description of worker and I/O threads in .NET What's clear to me regarding this topic (but may not be technically precise): Worker threads are threads that should employ CPU for their work; I/O threads…
Konstantin
  • 3,817
  • 4
  • 29
  • 39
62
votes
3 answers

I/O completion port's advantages and disadvantages

Why do many people say I/O completion port is a fast and nice model? What are the I/O completion port's advantages and disadvantages? I want to know some points which make the I/O completion port faster than other approaches. If you can explain it…
Benjamin
  • 10,085
  • 19
  • 80
  • 130
46
votes
7 answers

Linux and I/O completion ports?

Using winsock, you can configure sockets or seperate I/O operations to "overlap". This means that calls to perform I/O are returned immediately, while the actual operations are completed asynchronously by separate worker threads. Winsock also…
someguy
  • 7,144
  • 12
  • 43
  • 57
23
votes
2 answers

where/how can I find whether a .net class uses IOCP?

Update I asked the wrong question, rephrased (based on the great info on answers and comments): Is there any good source on .net's async operations being real async, thus either IOCP or async(overlapped)? Is there any quick way to find out if…
eglasius
  • 35,831
  • 5
  • 65
  • 110
17
votes
4 answers

IOCP threads - Clarification?

After reading this article which states : After a device finishes its job , (IO operation)- it notifies the CPU via interrupt. ... ... ... However, that “completion” status only exists at the OS level; the process has its own memory space…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
16
votes
7 answers

Using IOCP with UDP?

I'm pretty familiar with what Input/Output Completion Ports are for when it comes to TCP. But what, if I am for example coding a FPS game, or anything where need for low latency can be a deal breaker - I want immediate response to the player to…
Pythagoras of Samos
  • 3,051
  • 5
  • 29
  • 51
13
votes
4 answers

Scalable server framework in C++

I am looking to write a server application in C++ that is meant to handle tens of thousands of clients simultaneously. It should run under Windows and Linux. I have been looking around for frameworks and libraries and have come across Boost Asio,…
Philip Bennefall
  • 1,477
  • 5
  • 20
  • 33
12
votes
2 answers

How do Completion Port Threads of the Thread Pool behave during async I/O in .NET / .NET Core?

The .NET / .NET Core Thread Pool uses two different categories of threads internally: worker threads and I/O Completion Port (IOCP) threads. Both are just usual managed threads, but used for different purposes. Via different APIs (e.g. Task.Start or…
feO2x
  • 5,358
  • 2
  • 37
  • 46
12
votes
1 answer

GetQueuedCompletionStatus can't dequeue IO from IOCP if the thread which originally issued the IO is blocking in ReadFile under windows 8

My app stop working after switching to windows 8. I spend hours to debug the problem, found out IOCP behave differently between windows 8 and previous versions. I extract the necessary code to demonstrate and reproduce the problem. SOCKET…
czz
  • 474
  • 3
  • 9
9
votes
4 answers

Windows limitation on number of simultaneously opened sockets/connections per machine

Let's say I have Windows 7 with one real network interface and few loopback interfaces. I have IOCP enabled server that accepts connections from clients. I'm trying to simulate as much as possible real client connections to the server. My client…
a_m
  • 369
  • 1
  • 3
  • 12
9
votes
4 answers

Removing a handle from a I/O completion port and other questions about IOCP

The CreateIoCompletionPort function allows the creation of a new I/O completion port and the registration of file handles to an existing I/O completion port. Then, I can use any function, like a recv on a socket or a ReadFile on a file with a…
Etan
  • 17,014
  • 17
  • 89
  • 148
8
votes
1 answer

CreateFile() returns INVALID_HANDLE_VALUE but GetLastError() is ERROR_SUCCESS

I am opening a serial port using CreateFile(). I've got a testcase (too complicated to redistribute) that consistently causes CreateFile() to return INVALID_HANDLE_VALUE and GetLastError() to return ERROR_SUCCESS. By the looks of it, this bug only…
Gili
  • 86,244
  • 97
  • 390
  • 689
8
votes
1 answer

Windows 2012 R2 closesocket() hangs on listening socket

I have a weird situation on a production server. We have network application written on C++ which serves users requests by TCP written using IOCP. Two days ago we did an update of Windows 2012 R2 (it installed latest security updates. The previous…
Valentin
  • 860
  • 2
  • 10
  • 21
8
votes
1 answer

Calling WSAGetLastError() from an IOCP thread return incorrect result

I have called WSARecv() which returned WSA_IO_PENDING. I have then sent an RST packet from the other end. The GetQueuedCompletionStatus() function which exists in another thread has returned FALSE as expected, but when I called WSAGetLastError() I…
Tom
  • 1,344
  • 9
  • 27
8
votes
8 answers

Is there a I/O completion port based component for Delphi?

I am aware of Indy, ICS, Synapse and Clever InetSuite, none of which support IOCP. Is there anything else out there? Edit: I found iocpclasses , It's written in Delphi5. Better than nothing I suppose.
user219760
1
2 3
23 24