Async, Multiplexing, and Fairness
One endpoint may serve many connections, and each connection may contain many bidirectional and unidirectional streams. These lifecycles overlap without one task per packet.
Endpoint and connection state are mutex-protected because application futures
and runtime drivers may run on different worker threads. Critical sections call
the synchronous protocol core, update waker maps, and leave quickly; .await
does not occur while holding the lock.
Stream flow control bounds unconsumed bytes per stream and connection. QUIC congestion control separately bounds bytes in flight on the network. Socket buffer capacity, stream credit, connection credit, and congestion windows are different budgets and must not be collapsed into one “concurrency limit.”
The drivers cap receive/event/transmit work per poll. A self-wake requests another turn when work remains. This preserves throughput while giving the executor a scheduling boundary.
Parallelism comes from runtime tasks on several threads; protocol ordering remains serialized per connection under its state lock.