WinApi: IO Completion Ports

Optimus1

Explain, please:

From MSDN: https://docs.microsoft.com/en-us/windows/win32/fileio/i-o-completion-ports#supported-io-functions

Consider what happens with a concurrency value of one and multiple threads waiting in the GetQueuedCompletionStatus function call. In this case, if the queue always has completion packets waiting, when the running thread calls GetQueuedCompletionStatus, it will not block execution because, as mentioned earlier, the thread queue is LIFO. Instead, this thread will immediately pick up the next queued completion packet. No thread context switches will occur, because the running thread is continually picking up completion packets and the other threads are unable to run.

I don’t understand what other threads are we talking about?

PS: Sorry for such a simple and stupid question. I'm really confused.

SoronelHaetir

It is using the extreme example of NumberOfConcurrentThreads set to 1 but still having multiple threads calling GetQueuedCompletionStatus. It is saying that under those circumstances (that of there always being a packet queued) the first thread to return a packet will simply continue returning packets and the other threads waiting in GetQueuedCompletionStatus will continue waiting.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

IO Completion Ports and OVERLAPPED management

IO Completion Ports and socket send()

IO Completion Ports and socket WSARecv()

How to reregister for IO Completion ports for a handle

io completion ports issue with calling multiple wsarecv or wsasend per GetQueuedCompletionStatus

Windows: Event-based Overlapped IO vs IO Completion Ports, Real World Performance

Linux and I/O completion ports?

I/O Completion ports C++ And Threadpools

IO Completion port returning NULL Completion Key

AVR IO Ports can not be global

Async IO without completion port?

IO Completion port Linux equivalent

What are IO ports, serial ports and what's the difference between them?

Socket.io listening on multiple ports?

How to dynamically add IO ports to a Chisel Bundle?

AVR Is it possible to address IO ports indirectly

Dont see system.io.ports

How to verify or check I/O (Input / Output, io, IO) ports?

How does the operating system post io completion messages for async io

ASIO IO completion callbacks order vs the order of actual IO operations

Access to PIT (?) IO ports 44h and 46h - what do those ports do?

Problem with BytesToRead in System.IO.Ports C#

FileNotFoundException: Could not load file or assembly System.IO.Ports

System.TimeoutException in System.IO.Ports.dll error

Using system.io.ports c# Windows IoT Univeral

IO Completion Port Initial Read and Bi-Directional Data

socket.io connection after completion of ajax function

prometheus scrape ignores "prometheus.io/port: http-metrics" annotation and scrape all ports on the pod

How do I make IO ports which by made of generate function in verilog?