Skip to content

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

@frewsxcv

Description

@frewsxcv
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?

Activity

added
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Aug 11, 2017
changed the title [-]Are we able to specify default stack size for threads?[/-] [+]Are we able to document the default stack size for threads?[/+] on Aug 11, 2017
frewsxcv

frewsxcv commented on Aug 11, 2017

@frewsxcv
MemberAuthor
retep998

retep998 commented on Aug 11, 2017

@retep998
Member

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

frewsxcv

frewsxcv commented on Aug 13, 2017

@frewsxcv
MemberAuthor

Opened a PR: #43848

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @frewsxcv@retep998@Mark-Simulacrum

        Issue actions

          Are we able to document the default stack size for threads? · Issue #43805 · rust-lang/rust