-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Document new threading settings #47575
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
base: main
Are you sure you want to change the base?
Changes from all commits
7fc191e
2c938ed
d9cc746
50b6ae0
63c259c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,6 +31,17 @@ This article details the settings you can use to configure threading in .NET. | |||||
| | **runtimeconfig.json** | N/A | N/A | | ||||||
| | **Environment variable** | `COMPlus_Thread_AssignCpuGroups` or `DOTNET_Thread_AssignCpuGroups` | `0` - disabled<br/>`1` - enabled | | ||||||
|
|
||||||
| ## Set the stack size for threads created by the .NET runtime | ||||||
|
|
||||||
| - The default stack size is dictated by .NET and OS policies. The default stack size for .NET apps is 1.5 MB on Windows and macOS, and 8 MB on Linux. The default stack size when .NET runtime is hosted (for example, COM components) is dictated by the hosting process. | ||||||
| - This setting allows overriding the default for threads created by .NET runtime. For example, threads created by the <xref:System.Threading.Thread.%23ctor*> API. | ||||||
| - The specified size should be between 64 kB and 2 GB and a multiple of the natural allocation granularity of the OS. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Can we align the size up in the implementation so that this does not need to be documented? I think it is only a problem on Windows. This should behave just like the stackSize argument for
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| | | Setting name | Values | Version introduced | | ||||||
| | - | - | - | - | | ||||||
| | **runtimeconfig.json** | `System.Threading.DefaultStackSize` | A decimal integer that specifies the size of stack | .NET 10 | | ||||||
| | **Environment variable** | `DOTNET_Thread_DefaultStackSize` | A hexadecimal integer that specifies the size of stack | .NET 10 | | ||||||
|
|
||||||
| ## Minimum threads | ||||||
|
|
||||||
| - Specifies the minimum number of threads for the worker thread pool. | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.