-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 boolean field to indicate whether or not the Windows thread pool is being used #90551
Conversation
Tagging subscribers to this area: @mangod9 Issue Detailsnull
|
internal static bool UseWindowsThreadPool { get; } = | ||
AppContextConfigHelper.GetBooleanConfig("System.Threading.ThreadPool.UseWindowsThreadPool", "DOTNET_ThreadPool_UseWindowsThreadPool"); | ||
|
||
// Exposes whether or not the Windows thread pool is used for diagnostics purposes | ||
private static readonly bool s_useWindowsThreadPoolForDebugger = UseWindowsThreadPool; |
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.
internal static bool UseWindowsThreadPool { get; } = | |
AppContextConfigHelper.GetBooleanConfig("System.Threading.ThreadPool.UseWindowsThreadPool", "DOTNET_ThreadPool_UseWindowsThreadPool"); | |
// Exposes whether or not the Windows thread pool is used for diagnostics purposes | |
private static readonly bool s_useWindowsThreadPoolForDebugger = UseWindowsThreadPool; | |
private static readonly bool s_useWindowsThreadPool = // name relied on by sos | |
AppContextConfigHelper.GetBooleanConfig("System.Threading.ThreadPool.UseWindowsThreadPool", "DOTNET_ThreadPool_UseWindowsThreadPool"); | |
internal static bool UseWindowsThreadPool => s_useWindowsThreadPool; |
?
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.
I think the field should reflect what the property returns because the property can be stubbed by trimming, such that sos reflects the actual state of which thread pool is being used and not just the config value.
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.
I don't know if coreclr can use trimming currently, and maybe it's not relevant currently, but I suppose it doesn't hurt to assume that either coreclr could use trimming in the future or an sos for NativeAOT could exist in the future and show similar info.
…adPool.Windows.cs Co-authored-by: Stephen Toub <stoub@microsoft.com>
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.
Just one comment, otherwise LGTM, thanks!
src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Windows.cs
Outdated
Show resolved
Hide resolved
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.
Actually sorry, I think what you had initially was more correct. The field should reflect what the property returns because the property can be stubbed by trimming, such that sos reflects the actual state of what thread pool is being used and not just the config value.
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.
Thanks!
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6006105024 |
This field is being added for diagnostics purposes. It will be used by
ThreadPool
SOS command.