Skip to content

Check if initial_suspend can be used to detect context operation stacking #65

@kammce

Description

@kammce

See libhal/async_context:README.md#Avoid Operation Stacking for what operation stacking is.

When we create a top level coroutine we know that initial suspend is called and the coroutine does not proceed. The question is, does this only happen to top level coroutines? Does this step get bypassed if you co_await the future. If it is the case that initial_suspend is skipped when a future is co_awaited, then we can use this to check if the context's memory usage is non-zero. If its non-zero then we know that its preloaded.

But this assumes that somehow co_awaiting a future changes what happens when the coroutine's factory function is called. I'm not sure if there is such an asymmetry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions