Add System.Threading.Thread.UseAllCpuGroups runtimeconfig switch#90360
Add System.Threading.Thread.UseAllCpuGroups runtimeconfig switch#90360eduardo-vp wants to merge 2 commits intodotnet:mainfrom
Conversation
| 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.
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.
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.
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.
This is the only CLRConfig::EXTERNAL_ translated here. Seems unlikely to be needed.
Contributes to #81713