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.
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.
Comments