-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Document DOTNET_Thread_DefaultStackSize environment variable and runtimeconfig.json property for .NET 10 #49657
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
57fe00b
f693aca
6379675
25a138b
db3f8b3
b676e58
e6af8ed
a888838
9ea89da
0ec2054
4892484
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 |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| title: Threading config settings | ||
| description: Learn about the settings that configure threading for .NET apps. | ||
| ms.date: 11/04/2021 | ||
| ai-usage: ai-assisted | ||
| --- | ||
| # Runtime configuration options for threading | ||
|
|
||
|
|
@@ -265,3 +266,41 @@ Project file: | |
|
|
||
| </Project> | ||
| ``` | ||
|
|
||
| ## Default stack size for new threads | ||
|
|
||
| - Configures the default stack size for threads created by <xref:System.Threading.Thread> and other APIs that don't specify an explicit stack size. The value is specified as a hexadecimal number representing bytes. This setting doesn't affect the main application thread. | ||
| - If not specified, the default stack size is determined by the operating system. | ||
|
|
||
| | | Setting name | Values | Version introduced | | ||
| | - | - | - | - | | ||
|
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. @copilot This is only available on all platforms starting in .NET 10
Contributor
Author
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. Fixed in commit 4892484. Updated both the runtimeconfig.json property and environment variable to show ".NET 10" as the version introduced. |
||
| | **runtimeconfig.json** | `System.Threading.DefaultStackSize` | A hexadecimal integer value representing stack size in bytes. | .NET 10 | | ||
| | **MSBuild property** | N/A | N/A | N/A | | ||
| | **Environment variable** | `DOTNET_Thread_DefaultStackSize` | A hexadecimal integer value representing stack size in bytes. | .NET 10 | | ||
|
|
||
| ### Examples | ||
|
|
||
| *runtimeconfig.json* file: | ||
|
|
||
| ```json | ||
| { | ||
| "runtimeOptions": { | ||
| "configProperties": { | ||
| "System.Threading.DefaultStackSize": "0x100000" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| *runtimeconfig.template.json* file: | ||
|
|
||
| ```json | ||
| { | ||
| "configProperties": { | ||
| "System.Threading.DefaultStackSize": "0x100000" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| > [!NOTE] | ||
| > This setting doesn't affect threads that explicitly specify a stack size at creation. | ||
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.
@copilot keep all the old content, just add the new at the bottom
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.
Fixed in commit db3f8b3. Restored all original content and added the new DOTNET_Thread_DefaultStackSize section at the bottom.