Skip to content
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

Are we able to document the default stack size for threads? #43805

Closed
frewsxcv opened this issue Aug 11, 2017 · 3 comments
Closed

Are we able to document the default stack size for threads? #43805

frewsxcv opened this issue Aug 11, 2017 · 3 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@frewsxcv
Copy link
Member

One can specify the stack size of a thread via thread::Builder::stack_size. If one does not use this method when building a thread, it uses some default value, which is specified in util::min_stack.

It looks like util::min_stack looks at the RUST_MIN_STACK env var and attempts to parse it into an integer. If it's not specified or can't parse, it falls back to 2MB.

Should we update the thread documentation to mention what the default stack size is and mention that environment variable?

@frewsxcv frewsxcv added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Aug 11, 2017
@frewsxcv frewsxcv changed the title Are we able to specify default stack size for threads? Are we able to document the default stack size for threads? Aug 11, 2017
@frewsxcv
Copy link
Member Author

@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Aug 11, 2017
@retep998
Copy link
Member

Don't forget that the stack size of the main thread is not determined by Rust.

@frewsxcv
Copy link
Member Author

Opened a PR: #43848

frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 13, 2017
* Moves docs about stack size and thread naming from `Builder` to the
  `std::thread` module
* Adds more links to the new module-level documentation
* Mentions the 2 MiB stack size default, but indicate it's subject to
  change

Fixes rust-lang#43805.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Aug 15, 2017
…etMisdreavus

Rewrite/reorganize docs for stack size/thread names for spawned threads.

* Moves docs about stack size and thread naming from `Builder` to the
  `std::thread` module
* Adds more links to the new module-level documentation
* Mentions the 2 MiB stack size default, but indicate it's subject to
  change

Fixes rust-lang#43805.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants