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
1
vote
1 answer

Why IOCP doesn't work in BeginExecuteReader

I've read many articles say that IOCP is used in BeginXX/EndXX pair calls. However, when i test them, my result shown that IOCP didn't work in BeginExecuteReader call, while it worked just fine in BeginGetResponse call. I'm very confused with this…
purplewill
  • 21
  • 1
  • 3
1
vote
1 answer

What happens with Win32 IO Completion Port and synchronous appearing IO?

According to http://support.microsoft.com/kb/156932 calls to ReadFile can appear synchronous if certain conditions are met. For example if the target file is NTFS compressed. The article does not say anything about what happens if the file handle is…
1
vote
2 answers

IOCP and ReadFileEx usage

i'm playing with IOCP. I'm trying to write simple application that async reads data from the file in the main thread. However i'm getting error(ERROR_INVALID_PARAMETER) in ReadFileEx function, but seems i'm doing it ok. What am i doing wrong? Here…
user1266334
  • 153
  • 2
  • 12
1
vote
1 answer

Overlapped I/O: How to wake a thread on a completion port event or a normal event?

I want to use a thread pool to both initiate/cancel overlapped read operations -- using ReadFile() and CancelIo() respectively -- as well as handling any completion port events when read operations complete. Any thread can initiate a read…
Gili
  • 86,244
  • 97
  • 390
  • 689
1
vote
1 answer

Non-blocking socket connect on Windows without ConnectEx

I need to initiate 1000's of client connections in a single process, the key limitation I need to work around is the driver does not support ConnectEx, so I cannot have a pure IOCP solution. My first thought was a thread pool to handle connections,…
user172783
1
vote
0 answers

Debugging a nasty Lock Contention issue in ASP.NET Core MVC

We are dealing with a nasty lock contention issue in a high traffic ASP.NET Core MVC app in .NET 6, hosted as in-process in IIS Windows Server. We are trying to enable a feature that makes an Http call to an internal service, and when we enable the…
Gpower2
  • 11
  • 2
1
vote
0 answers

Setting IOCP Threads min/max in .NET core - verifying the effect of the change

Currently it is possible to set minimum and maximum worker threads via runtimeconfig.json (https://learn.microsoft.com/en-us/dotnet/core/runtime-config/threading). The docs mention this is equivalent to calling ThreadPool.SetMinThreads()…
Bartosz
  • 4,406
  • 7
  • 41
  • 80
1
vote
1 answer

Problem with wsarecv while using with IOCP

I am new to IOCP and struggling with this for last few weeks. I have pasted some core part of my code below related to IOCP.This may not be executed perfectly as I clipped some part to make it easy to understand. I am struggling while receiving the…
Nipun
  • 31
  • 1
  • 5
1
vote
1 answer

How to deal with many incoming UDP packets when the server has only 1 UDP socket?

When a server has only 1 UDP socket, and many clients are sending UDP packets to it, what would be the best approach to handle all of the incoming packets? I think this can also be a problem with TCP packets, since there's a limited thread count,…
Tomson
  • 73
  • 5
1
vote
1 answer

Does IOCP and io_uring read/write Asynchronous?

As far as I konw. Linux epoll is asynchronous notification. when a file descriptor become readable/writeable/acceptable, epoll_wait will return this fd. But read or write is still synchronous, will block thread. So Redis 6.0 use a thread pool to…
LGG
  • 31
  • 1
  • 3
1
vote
4 answers

Packet timing problem

I have a client that every 8 seconds will send a packet to a server. If the server detects the packets are sent too fast it will disconnect the client. In the client I call Sleep(8000); before sending the packet. On the server side I use…
ares94
  • 163
  • 1
  • 8
1
vote
0 answers

Large delay (10 seconds) occurs sometimes between PostQueuedCompletionStatus and GetQueuedCompletionStatus

This is related to a previous post Recv Buffer for IO Completion port always empty I've added a PostQueuedCompletionStatus to my code to allow me to trigger messages in the IOCP worker threads. This works most of the time, but every once in a while…
user2076574
  • 166
  • 3
  • 12
1
vote
0 answers

IOCP Socket Worker threads works too much slow when i test it with client simulator

I'm developing a mmorpg with iocp sockets.When im testing with my client simulator , after 70-80 connection , writing operation at socket worker thread slowing down than users get lagged. This is my worker thread ; typedef…
XANTY1
  • 11
  • 1
1
vote
1 answer

How to allocated thread pool while using asyncio ProactorEventLoop

I'm currently using asyncio in Python 3.7 and write a TCP server using the asyncio.start_server() function refer to this example: https://docs.python.org/3/library/asyncio-stream.html Also try asyncio.ProactorEventLoop that uses “I/O Completion…
1
vote
0 answers

Graceful socket closure with IOCP

I wrote a C++ application which can act as both server and a client depending upon command line arguments. So, the client will initiate a connection and the server will accept and the data transfer will take place, and I will always have one pending…