Skip to content

windows: use the default IOCP concurrency value.#1161

Merged
carllerche merged 2 commits intov0.6.xfrom
fix-iocp-concurrency
Nov 22, 2019
Merged

windows: use the default IOCP concurrency value.#1161
carllerche merged 2 commits intov0.6.xfrom
fix-iocp-concurrency

Conversation

@carllerche
Copy link
Member

IOCP is initialized with the max number of threads that can be
"associated" with the IOCP handle. A thread becomes associated with IOCP
when it is woken after selecting. It remains associated with IOCP until
the thread sleeps for any reason (blocking I/O, yield, page fault,
sleep, ...).

Currently, the value is set to 1. However, this was picked mostly
because I had no idea what it meant to be "associated" with IOCP and 1
sounded good. It turns out that 0 is lets windows pick a default value
(number of cores). This makes much more sense than 1.

ref: https://docs.microsoft.com/en-us/windows/win32/fileio/i-o-completion-ports#threads-and-concurrency

IOCP is initialized with the max number of threads that can be
"associated" with the IOCP handle. A thread becomes associated with IOCP
when it is woken after selecting. It remains associated with IOCP until
the thread sleeps for any reason (blocking I/O, yield, page fault,
sleep, ...).

Currently, the value is set to 1. However, this was picked mostly
because I had no idea what it meant to be "associated" with IOCP and 1
sounded good. It turns out that 0 is lets windows pick a default value
(number of cores). This makes much more sense than 1.

ref: https://docs.microsoft.com/en-us/windows/win32/fileio/i-o-completion-ports#threads-and-concurrency
@carllerche carllerche merged commit 56831e9 into v0.6.x Nov 22, 2019
@carllerche carllerche deleted the fix-iocp-concurrency branch November 27, 2019 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants