-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add System.Threading.Thread.UseAllCpuGroups runtimeconfig switch #90360
Add System.Threading.Thread.UseAllCpuGroups runtimeconfig switch #90360
Conversation
@@ -60,6 +60,8 @@ FCIMPL4(INT32, ThreadPoolNative::GetNextConfigUInt32Value, | |||
case 18: if (TryGetConfig(CLRConfig::INTERNAL_HillClimbing_SampleIntervalHigh, false, W("System.Threading.ThreadPool.HillClimbing.SampleIntervalHigh"))) { return 19; } FALLTHROUGH; | |||
case 19: if (TryGetConfig(CLRConfig::INTERNAL_HillClimbing_GainExponent, false, W("System.Threading.ThreadPool.HillClimbing.GainExponent"))) { return 20; } FALLTHROUGH; | |||
|
|||
case 20: if (TryGetConfig(CLRConfig::EXTERNAL_Thread_UseAllCpuGroups, false, W("System.Threading.Thread.UseAllCpuGroups"))) { return 21; } FALLTHROUGH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to it here? The threadpool should not care about CPU groups.
Also, this setting has complicated interactions with the OS defaults and the GC configuration. Reading the setting alone won't tell you much about whether the CPU groups are enabled or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be useful to submit a parallel doc PR to update the documentation to make sure that we like behavior of this switch. The behavior is not documented properly today: https://learn.microsoft.com/en-us/dotnet/core/runtime-config/threading#cpu-groups. The default depends on the Windows OS version and this settings takes effect only when the CPU groups are enable for the GC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default depends on the Windows OS version
Some context:
https://learn.microsoft.com/en-us/windows/win32/procthread/processor-groups#behavior-starting-with-windows-11-and-windows-server-2022
#68639
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only CLRConfig::EXTERNAL_
translated here. Seems unlikely to be needed.
Contributes to #81713