Skip to content

Commit

Permalink
Rewrite driver to use a state machine
Browse files Browse the repository at this point in the history
This passes the responsibility for calling the Reactor between threads
instead of relying on main_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
  • Loading branch information
danieldg committed Jul 25, 2021
1 parent 36ab1d2 commit 5e99aed
Show file tree
Hide file tree
Showing 4 changed files with 513 additions and 136 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ concurrent-queue = "1.2.2"
futures-lite = "1.11.0"
log = "0.4.11"
once_cell = "1.4.1"
parking = "2.0.0"
polling = "2.0.0"
slab = "0.4.2"
socket2 = { version = "0.4.0", features = ["all"] }
Expand Down
Loading

0 comments on commit 5e99aed

Please sign in to comment.