Uh oh!
There was an error while loading. Please reload this page.
Rewrite/reorganize docs for stack size/thread names for spawned threads. - #43848
Conversation
rust-highfive
commented
Aug 13, 2017
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
commented
Aug 13, 2017
cc @rust-lang/docs and maybe someone from @rust-lang/libs (sorry for all the pings!) |
49b20bb to
0f6e43cCompareThere was a problem hiding this comment.
Please specify the unit of RUST_MIN_STACK is "bytes" (e.g. RUST_MIN_STACK=4194304 for a 4 MiB stack).
There was a problem hiding this comment.
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 Fixesrust-lang#43805.
0f6e43c to
150713cCompare| //! 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`]. |
There was a problem hiding this comment.
I'd note here that the name is also provided to the OS where applicable (e.g. pthread_setname_np).
| //! * 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). | ||
| //! |
There was a problem hiding this comment.
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).
QuietMisdreavus
commented
Aug 14, 2017
Looks good! r=me after addressing @durka's comment |
QuietMisdreavus
commented
Aug 14, 2017
@bors r+ rollup |
bors
commented
Aug 14, 2017
📌 Commit 6594601 has been approved by |
…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 Fixesrust-lang#43805.
Builderto thestd::threadmodulechange
Fixes#43805.