Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better async waiting for when the write op channel is full #323

Merged
merged 3 commits into from
Sep 9, 2023

Conversation

tatsuya6502
Copy link
Member

@tatsuya6502 tatsuya6502 commented Sep 9, 2023

This PR replaces the async may_yield function introduced at v0.12.0-beta.1 with a more efficient implementation. It uses an async_lock::RwLock between a user async task, that is currently running internal do_run_pending_tasks, and other user async tasks.

This will be more CPU efficient than may_yield because it makes some of the user async tasks to wait for reader locks, rather than keeping spinning, so that the async runtime scheduler can run other async tasks if there are any.

This PR also bumps the version to v0.12.0-beta.3.

@tatsuya6502 tatsuya6502 self-assigned this Sep 9, 2023
@tatsuya6502 tatsuya6502 added the enhancement New feature or request label Sep 9, 2023
@tatsuya6502 tatsuya6502 added this to the v0.12.0 milestone Sep 9, 2023
Copy link
Member Author

@tatsuya6502 tatsuya6502 left a comment

Choose a reason for hiding this comment

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

Merging.

@tatsuya6502 tatsuya6502 added this pull request to the merge queue Sep 9, 2023
Merged via the queue into main with commit eddec37 Sep 9, 2023
@tatsuya6502 tatsuya6502 deleted the better-async-yielding branch September 9, 2023 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant