Skip to content
Open
15 changes: 15 additions & 0 deletions docs/core/runtime-config/threading.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -265,3 +266,17 @@ Project file:

</Project>
```

## Default stack size for new threads

- Configures the default stack size (in bytes) for threads created by <xref:System.Threading.Thread> and other APIs that don't specify an explicit stack size.
- If not specified, the default stack size is determined by the operating system.

| | Setting name | Values | Version introduced |
| - | - | - | - |
| **runtimeconfig.json** | N/A | N/A | N/A |
| **MSBuild property** | N/A | N/A | N/A |
| **Environment variable** | `DOTNET_Thread_DefaultStackSize` | An integer value representing stack size in bytes | .NET 9 |

> [!NOTE]
> This setting does not affect threads created with an explicitly specified stack size.