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

Rewrite driver to use a state machine #69

Closed
wants to merge 1 commit into from

Conversation

danieldg
Copy link

This passes the responsibility for calling the Reactor between threads
instead of relying on the async-io thread to pick up the abandoned
Reactor. Threads that are waiting in block_on are likely to acquire the
reactor on their second wait, and the main thread is only woken if there
are no block_on threads polling.

This also adds support for disabling the async-io thread, which allows
applications that only process I/O from within block_on to avoid the
needless thread creation. It also supports designating the async-io
thread as the sole owner of the Reactor to avoid this pass-the-reactor
behavior, if that is undesired.

fixes #40

This passes the responsibility for calling the Reactor between threads
instead of relying on the async-io thread to pick up the abandoned
Reactor.  Threads that are waiting in block_on are likely to acquire the
reactor on their second wait, and the main thread is only woken if there
are no block_on threads polling.

This also adds support for disabling the async-io thread, which allows
applications that only process I/O from within block_on to avoid the
needless thread creation.  It also supports designating the async-io
thread as the sole owner of the Reactor to avoid this pass-the-reactor
behavior, if that is undesired.

fixes smol-rs#40
@taiki-e
Copy link
Collaborator

taiki-e commented Sep 8, 2022

Closing per decision in #40.

Thanks anyway for the PR!

@taiki-e taiki-e closed this Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Avoid spawning the async-io thread if possible
2 participants