On Fri, Oct 17, 2014 at 8:15 AM, Monish Gandhi <monishgandhi@xxxxxxxxx
> I am trying to understand Jetty's Connector implementation which uses
> multiple acceptor/selectors to have non blocking implementation. I saw a
> post from Simone where its explained very clearly
> I could see the Jetty's SelectorManager, AbstractConnector, ServerConnector
> implementing the same where we have n acceptor and m selector threads
> started. The acceptors are blocking on the ServerSocketChannels accept()
> call, each time when the socket connects, acceptor takes the socket and
> registers the channel with selector and submits the job to selector
> (ManagedSelector' ConcurrentArrayQueue) selector threads would poll the
> queue and run the changes. However i am somehow missing one thing, where is
> the actual dispatch happening to the Worker threads (the actual Server
> threads in QueuedThreadPool). Also let me know if I got some of above
The dispatch happens when calling SelectChannelEndPoint.onSelected()
This goes back to the callback that the Connection registered with the
Here, the state goes (typically) from FILL_INTERESTED to FILLING, and
AbstractConnection.FillingState is where the dispatch happens, calling
Connection.onFillable() in the dispatched thread.
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.