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

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

Merged
merged 3 commits into from
Aug 15, 2017

Conversation

frewsxcv
Copy link
Member

  • 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 #43805.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @aturon (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@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 13, 2017
@frewsxcv
Copy link
Member Author

cc @rust-lang/docs and maybe someone from @rust-lang/libs (sorry for all the pings!)

@frewsxcv frewsxcv changed the title Rewrite docs for stack size/thread names for spawned threads. Rewrite/reorganize docs for stack size/thread names for spawned threads. Aug 13, 2017
//!
//! * Build the thread with [`Builder`] and pass the desired stack size to [`Builder::stack_size`].
//! * Set the `RUST_MIN_STACK` environment variable to an integer representing the desired stack
//! size.
Copy link
Member

Choose a reason for hiding this comment

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

Please specify the unit of RUST_MIN_STACK is "bytes" (e.g. RUST_MIN_STACK=4194304 for a 4 MiB stack).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call! Addressed in the latest force push

* 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.
//! Threads are able to have associated names for identification purposes. For example, the thread
//! name is used in panic messages. By default, spawned threads are unnamed. To specify a name for
//! a thread, build the thread with [`Builder`] and pass the desired thread name to
//! [`Builder::name`]. To retrieve the thread name from within the thread, use [`Thread::name`].
Copy link
Member

Choose a reason for hiding this comment

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

I'd note here that the name is also provided to the OS where applicable (e.g. pthread_setname_np).

Copy link
Member Author

Choose a reason for hiding this comment

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

this seem fine? 10bd80d

//! * Build the thread with [`Builder`] and pass the desired stack size to [`Builder::stack_size`].
//! * Set the `RUST_MIN_STACK` environment variable to an integer representing the desired stack
//! size (in bytes).
//!
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't make it clear which method takes priority, in case the env var is set but you also use Builder (I assume the Builder wins).

@carols10cents carols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 14, 2017
@QuietMisdreavus
Copy link
Member

Looks good! r=me after addressing @durka's comment

@QuietMisdreavus
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 14, 2017

📌 Commit 6594601 has been approved by QuietMisdreavus

@frewsxcv frewsxcv added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 14, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request 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.
bors added a commit that referenced this pull request Aug 15, 2017
Rollup of 6 pull requests

- Successful merges: #43756, #43790, #43846, #43848, #43862, #43868
- Failed merges:
@bors bors merged commit 6594601 into rust-lang:master Aug 15, 2017
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 S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants