users@grizzly.java.net

Using multiple selector handlers on the client side

From: Tomasz Kowalczewski <tomasz.kowalczewski_at_gmail.com>
Date: Fri, 10 Oct 2008 14:49:12 +0200

Hello,

I have a question related to usage of multiple (TCP)SelectorHandler-s on the
client side. Does this provide any performance benefit when having client
implementation that keeps connections to many servers (and 2-3 connections
to each server)? Normally I would presume that having multiple selectors
would help, but looking at grizzly implementation I see that:

1) TCPSelectorHandler javadoc says: "One or more instance of a Selector are
handled by SelectorHandler" and yet I cannot see this in code - it handles
only one selector.
2) When creating new connector handler by
"controller.acquireConnectorHandler( Protocol.TCP )" I can track this down
to DefaultConnectorHandlerPool class which calls back to
controller.getSelectorHandler(protocol). This method always returns first
SelectorHandler on a list that supports given protocol.

Waiting for your input.

Thanks,
Tomasz