Skip to content

allow choosing the initial stack size #5768

Closed
@thestinger

Description

@thestinger

The main task could just start with a big stack segment (like 8MiB), and choosing whether a spawned task uses the conservative stack growth strategy could be optional. Segmented stacks are a scalability feature so the main task won't matter. On x86_64 Linux, a stack will be lazily allocated page-by-page anyway and the address space doesn't matter, it just won't shrink back down like a segmented stack. I don't know about other platforms.

The API could be opt-in or opt-out, as long as it's possible to use segmented stacks for scaling I/O and avoid them for code that really needs performance (memory locality matters a lot, the allocations themselves probably aren't too bad).

@brson, @pcwalton: any thoughts on whether this would be a sane thing to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions