Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/core/runtime-config/threading.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 size of stack for VM-created threads

- The default size of stack is dictated by VM and OS policies.
- This setting allows overriding the default.
- The specified size should be between 64 kB and 2 GB and a multiple of the natural allocation granularity of the OS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a multiple of the natural allocation granularity of the OS

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 System.Threading.Thread constructor where we do the same.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The specified size should be between 64 kB and 2 GB and a multiple of the natural allocation granularity of the OS.
- The specified size should be between 64 kB and 2 GB.


| | 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.
Expand Down