From 7fc191e7a4553c67e7398f5232da58ad350025cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 25 Jul 2025 11:50:04 +0200 Subject: [PATCH 1/2] Document new threading settings Added in https://github.com/dotnet/runtime/pull/110455. --- docs/core/runtime-config/threading.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/core/runtime-config/threading.md b/docs/core/runtime-config/threading.md index b2806433ca0a2..acef9b08082ef 100644 --- a/docs/core/runtime-config/threading.md +++ b/docs/core/runtime-config/threading.md @@ -31,6 +31,18 @@ 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
`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. + +| | 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. From 2c938ed595a64ff9bbfa715d073589018b24a802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 25 Jul 2025 11:58:00 +0200 Subject: [PATCH 2/2] Update threading.md --- docs/core/runtime-config/threading.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/core/runtime-config/threading.md b/docs/core/runtime-config/threading.md index acef9b08082ef..cde6e9f1cf262 100644 --- a/docs/core/runtime-config/threading.md +++ b/docs/core/runtime-config/threading.md @@ -42,7 +42,6 @@ This article details the settings you can use to configure threading in .NET. | **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.