Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Acceptor Threads and _acceptChannel config

Hi,

On Mon, May 26, 2025 at 6:29 PM code crafter via jetty-dev
<jetty-dev@xxxxxxxxxxx> wrote:
> From the comments and code (https://github.com/jetty/jetty.project/blob/47959d983523118e1c9cb63935112b0a29db99cd/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java#L320), it seems an AbstractConnector should block when waiting on accepts.

Correct, if there is at least 1 acceptor thread.

> But the _acceptChannel is configured to be non-blocking down the line (https://github.com/jetty/jetty.project/blob/47959d983523118e1c9cb63935112b0a29db99cd/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java#L235) . This is consistent with creating and blocking on selectors, accepting in a non-blocking fashion,

The _acceptChannel is only configured in non-blocking mode if the
number of acceptor threads is zero.
In this case, _acceptChannel is registered in the selector for
OP_ACCEPT events, so it accepts new connections in non-blocking mode,
without busy loops.

Cheers
-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top