NOTE

Netty Source: NioEventLoop Run Loop

Selector waiting, selected-key processing, queued tasks, scheduling, and fairness inside a Netty NIO event loop.

JavaCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

A NioEventLoop repeatedly coordinates three categories of work: wait for/select I/O readiness, process selected channel events, and run queued/scheduled tasks.

Netty versions include policies for balancing I/O work against task execution so one side does not permanently starve the other. Wakeups are used when work is submitted from outside the event-loop thread.

Selector-rebuild/workaround details and loop internals have changed across JDK/Netty releases. The durable concern is event-loop latency: do not run long blocking/CPU tasks on this loop.

Loading helpful count