Skip to content

Ways to specify thread stack size #1008

@lihe07

Description

@lihe07

When we are trying to spawn a memory costy task with async-std
async_std::task::spawn(some_future())
It throws thread 'async-std/runtime' has overflowed its stack

Although we can solve this problem with the following code:

thread::Builder::new().stack_size(32 * 1024).spawn(|| {
    async_std::task::block_on(some_future())
}).unwrap();

But if async_std also has the specified task stack size, it can save some time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions