Skip to content

Document new threading settings #47575

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MichalStrehovsky
Copy link
Member

@MichalStrehovsky MichalStrehovsky commented Jul 25, 2025


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

@BillWagner BillWagner modified the milestones: July 2025, August 2025 Aug 6, 2025

- The default stack size is dictated by .NET and OS policies. The default stack size for .NET apps is 1.5 MB on Windows and macOS, and 8 MB on Linux. The default stack size when .NET runtime is hosted (for example, COM components) is dictated by the hosting process.
- This setting allows overriding the default for threads created by .NET runtime. For example, threads created by the <xref:System.Threading.Thread.%23ctor*> API.
- 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.

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.

Copy link
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

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.

4 participants