Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Where does Jetty dispatch to worker thread happens.

Thanks Simone, I am trying to understand how does configuring more acceptor help. Suggested number is equal to number of cores. The Either ways multiple acceptor threads would compete but only one would succeed. Which means all acceptor threads would be in BLOCKED state (waiting to lock) and only one would be RUNNABLE.  

On Monday, October 20, 2014 6:16 PM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:


On Fri, Oct 17, 2014 at 5:39 PM, Monish Gandhi <monishgandhi@xxxxxxxxx> wrote:
> Thanks Simone ! Also could you please confirm that the when socket connects
> and acceptor thread accepts the same, when does it go back to accepting new
> connections. Is it after registering ServerSocketChannel with selector and
> submitting to Selector queue (_changes.offer in SelectorManager.submit()). I
> assume the state in this SelectorManager.submit() in such case would be
> "PROCESS" and hence should come out immediately.

When a connection is accepted, it is passed to
SelectorManager.accept(), that returns immediately so that a new
connection may be accepted.
The number of acceptors can be configured, and those will all compete
to accept connections (although only one will succeed).

>  Is it ever possible that if my selectors are busy then my acceptor thread
> won't go back to accepting new connections?

No, it's not possible.

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

Back to the top