-
Notifications
You must be signed in to change notification settings - Fork 1.5k
<thread>: (lack of) Support for >64 cores #2099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Other two affected places are |
I'm not really sure where would you want to see it documented. In sources? You don't look up sources often, probably you won't be looking there when everything seems to work. There: https://docs.microsoft.com/en-us/cpp/standard-library/thread-class ? cppreference.com ? I don't think they will accept platform-specific details. |
It is also not simple to come up with short and precise messages. My take is as follows (not too short, and possibly imprecise):
|
That is indeed a difficult question. But I think just having this issue here is a good start :). |
Maybe as the most inclusive version:
|
FYI @TylerMSFT, this is an STL docs issue. |
It looks like the MicrosoftDocs PR has just been merged (thanks @AlexGuteniev, @TylerMSFT) -- it looks like the docs PR adds this information to the Is this documentation sufficient to close this issue? |
Four months after this issue was raised, the updated documentation indicates that Windows 11 and Windows Server 2022 allow programs to use all CPU cores with default affinity. It seems that STL will not need to address this issue, and the documentation will need to be updated again to reflect the actual situation of Windows 11 and Windows Server 2022. @StephanTLavavej |
@TylerMSFT Could you see about updating the pertinent docs to clarify this isn't an issue in Windows 11/Windows Server 2022 or later? |
Added to my backlog. |
I updated the documentation for Please close this issue if those updates suffice. |
Thanks, TylerMSFT! Hopefully we can finally put this issue to bed. |
We later merged #5459 to fix |
The stl is currently limited to using 64 cores: Threads created with std::thread will only ever occupy 64 cores (see #1238 (comment)) and std::hardware_concurrency returns a maximum of 64 (see #594).
With the availability of the 128 (logical) core Threadripper this is becoming less of a philosophical issue and becoming more relevant for real-world applications.
My understanding is that given the current win32 API, manual thread affinity management is necessary to access more than 64 cores (see e.g. the way the TBB starts threads). So this might not actually be fixable within the STL. In that case the STL should probably at least clearly document this limitation somewhere, since it is a rather surprising arbitrary limit.
Some background information on the 64 core problem in win32: https://docs.microsoft.com/en-us/windows/win32/procthread/processor-groups
The text was updated successfully, but these errors were encountered: