libbitcoin-network is also the threading engine for libbitcoin-node and libbitcoin-server. Node introduces additional thread pools for parallel validation, though these are isolated. Server introduces one thread per endpoint worker (well isolated within libbitcoin-protocol).
This rework dramatically simplifies the threading model, so that we are operating on one dedicated thread per socket/channel. While the implementation remains entirely asynchronous, this will eliminate a lot of complexity and resolve certain issues in our use of boost::asio. It will also reduce our DOS attack surface to almost nothing. I expect it will also finally resolve the shutdown hang (deadlock). If it resurfaces, it will certainly be much easier to troubleshoot.
We may possibly experience a performance hit, as we will not be queueing up arbitrary amounts of work when our processing speed is out of sync with network speed. However, this is the DOS vector. If there's a material hit I would create a managed work buffer, dropping outbound messages or blocking inbound messages as necessary (which is how we manage ZeroMQ buffering).
(edited)