Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Summary

Adds documentation for the new DOTNET_Thread_DefaultStackSize environment variable and System.Threading.DefaultStackSize runtimeconfig.json property introduced in .NET 10, which configures the default stack size for threads created without an explicitly specified stack size. The value is specified as a hexadecimal number representing bytes, and this setting does not affect the main application thread.

The documentation follows the standard format used by other threading configuration sections in the file, including:

  • Concise 2-bullet description explaining the setting's purpose, format, and default behavior
  • Complete configuration table showing all three configuration types (runtimeconfig.json, MSBuild property, and Environment variable)
  • Examples section demonstrating usage in runtimeconfig.json and runtimeconfig.template.json files
  • NOTE callout explaining that threads with explicit stack size specifications are unaffected by this setting

Changes Made

  • Added ai-usage: ai-assisted to the frontmatter as required
  • Added "Default stack size for new threads" section at the bottom of existing content
  • Preserved all original documentation content (267 lines)
  • Followed the established format pattern used throughout the threading.md file
  • Configuration table includes:
    • System.Threading.DefaultStackSize runtimeconfig.json property (.NET 10)
    • DOTNET_Thread_DefaultStackSize environment variable (.NET 10)
    • MSBuild property marked as N/A (not available)
  • Added Examples section with runtimeconfig.json and runtimeconfig.template.json usage examples showing hexadecimal value format (0x100000 for 1 MB)
  • Used xref to link to System.Threading.Thread API documentation
  • Clarified that the value is specified as a hexadecimal number representing bytes
  • Documented that the setting does not affect the main application thread
  • Used conversational tone with contractions for consistency with Microsoft documentation style
  • Updated version information to reflect .NET 10 availability across all platforms

Testing

  • ✅ Markdown linting passes with no errors
  • ✅ Section format matches other threading configuration sections in the file
  • ✅ Code review passes with no critical issues
  • ✅ All original content preserved and new section added at the end (file is now 306 lines)

The changes maintain consistency with the existing documentation style and structure.

Original prompt

Update docs/core/runtime-config/threading.md to include documentation for the new environment variable DOTNET_Thread_DefaultStackSize=val, which sets the stack size, in bytes, for new VM threads created with the default stack size. Add a section describing what it does, a configuration table, usage examples for several platforms, and a note that threads created with an explicit stack size are unaffected. Include this in the appropriate section following the style of the current threading configuration documentation. Make sure to add the frontmatter ai-usage: ai-assisted.

Example table entry:

Setting name Values Version introduced
Environment variable DOTNET_Thread_DefaultStackSize An integer value (bytes). Example: 1048576 for 1 MB .NET 9

This pull request was created as a result of the following prompt from Copilot chat.

Update docs/core/runtime-config/threading.md to include documentation for the new environment variable DOTNET_Thread_DefaultStackSize=val, which sets the stack size, in bytes, for new VM threads created with the default stack size. Add a section describing what it does, a configuration table, usage examples for several platforms, and a note that threads created with an explicit stack size are unaffected. Include this in the appropriate section following the style of the current threading configuration documentation. Make sure to add the frontmatter ai-usage: ai-assisted.

Example table entry:

Setting name Values Version introduced
Environment variable DOTNET_Thread_DefaultStackSize An integer value (bytes). Example: 1048576 for 1 MB .NET 9

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Internal previews

📄 File 🔗 Preview link
docs/core/runtime-config/threading.md docs/core/runtime-config/threading

Copilot AI changed the title [WIP] Update threading documentation for new environment variable Document DOTNET_Thread_DefaultStackSize environment variable for .NET 9 Nov 7, 2025
Copilot finished work on behalf of agocke November 7, 2025 00:48
Copilot AI requested a review from agocke November 7, 2025 00:48
Copilot finished work on behalf of agocke November 7, 2025 17:47
Copilot AI requested a review from agocke November 7, 2025 17:47
@agocke
Copy link
Member

agocke commented Nov 7, 2025

@copilot Please adjust the PR to be against main

@agocke agocke changed the base branch from doc/thread-stacksize-envvar to main November 7, 2025 17:53
Copy link
Contributor Author

Copilot AI commented Nov 7, 2025

@copilot Please adjust the PR to be against main

I don't have the ability to change the base branch of the PR directly from this environment. You'll need to either:

  1. Change the base branch using GitHub's UI (there's a button in the PR that says "Edit" next to the branches)
  2. Or rebase the branch against main manually

The documentation changes are complete and ready - the file is standalone and should merge cleanly into main.

Copilot AI requested a review from agocke November 7, 2025 17:55
Copilot finished work on behalf of agocke November 7, 2025 17:55
Copilot finished work on behalf of agocke November 7, 2025 18:06
@agocke agocke marked this pull request as ready for review November 7, 2025 19:53
@agocke agocke requested review from a team and gewarren as code owners November 7, 2025 19:53
Copilot AI review requested due to automatic review settings November 7, 2025 19:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds documentation for the DOTNET_Thread_DefaultStackSize environment variable, a new .NET 9 runtime configuration option that controls the default stack size for newly created threads. The documentation follows the established pattern used elsewhere in the threading configuration file.

  • Adds the ai-usage: ai-assisted frontmatter metadata
  • Documents the new DOTNET_Thread_DefaultStackSize environment variable for .NET 9
  • Provides examples for setting the environment variable across different platforms and shells

Copilot AI requested a review from agocke November 7, 2025 20:02
Copilot finished work on behalf of agocke November 7, 2025 20:02
Copilot AI requested a review from agocke November 7, 2025 20:10
Copilot finished work on behalf of agocke November 7, 2025 20:10
Copilot AI changed the title Document DOTNET_Thread_DefaultStackSize environment variable for .NET 9 Document DOTNET_Thread_DefaultStackSize environment variable and runtimeconfig.json property for .NET 9 Nov 7, 2025
Copilot finished work on behalf of agocke November 7, 2025 20:16
Copilot AI changed the title Document DOTNET_Thread_DefaultStackSize environment variable and runtimeconfig.json property for .NET 9 Document DOTNET_Thread_DefaultStackSize environment variable and runtimeconfig.json property for .NET 10 Nov 7, 2025
Copilot AI requested a review from agocke November 7, 2025 20:25
Copilot finished work on behalf of agocke November 7, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants