Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

fix: sleep in async executor when there are no futures left to poll #26

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

Gavin-Niederman
Copy link
Member

@Gavin-Niederman Gavin-Niederman commented Jan 5, 2024

Describe the changes this PR makes. Why should it be merged?

The async executor now sleeps when there are no futures left for it to poll.
This stops it from completely starving the OS even when the user has awaited a sleep future.
The complete_all function has also been removed because it was broken and could not easily be fixed.

Additional Context

This has been tested in the simulator and on a real V5 Brain.

Copy link
Member

@doinkythederp doinkythederp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed something that might be a mistake.

pros/src/async_runtime/executor.rs Show resolved Hide resolved
@Gavin-Niederman Gavin-Niederman marked this pull request as ready for review January 5, 2024 03:27
Copy link
Member

@doinkythederp doinkythederp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Gavin-Niederman Gavin-Niederman merged commit 4ce49e0 into main Jan 5, 2024
6 checks passed
@Gavin-Niederman Gavin-Niederman deleted the async_loop_delay branch January 5, 2024 03:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants