async-io
async-io copied to clipboard
Rewrite driver to use a state machine
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