You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Alwyn Schoeman <al...@gmail.com> on 2007/05/20 20:52:32 UTC

SocketConnector, worker thread and workertimeout

Hi everyone,

Is the standard usecase for SocketConnector to use the same connector to
make multiple remote connections?  I would think it is as I can see no other
way to manage a single selector and thread.

What is the definition of the 'worker thread' that is related to
'workertimeout'.  Is it the thread that manages the selector?

What is the timeout for?  Is the worker only active when connecting and the
timeout a connection timeout?

Thanks,
Alwyn
-- 
View this message in context: http://www.nabble.com/SocketConnector%2C-worker-thread-and-workertimeout-tf3786722.html#a10708749
Sent from the mina dev mailing list archive at Nabble.com.


Re: SocketConnector, worker thread and workertimeout

Posted by Trustin Lee <tr...@gmail.com>.
Hi Alwyn,

On 5/21/07, Alwyn Schoeman <al...@gmail.com> wrote:
>
> Hi everyone,
>
> Is the standard usecase for SocketConnector to use the same connector to
> make multiple remote connections?

It depends on your situation.  I'd use the same connector for the
connections that connects to the same host (or host group) for better
manageability.

> I would think it is as I can see no other
> way to manage a single selector and thread.

Could you explain a little bit in more detail?

> What is the definition of the 'worker thread' that is related to
> 'workertimeout'.  Is it the thread that manages the selector?

'Worker' in workertimeout actually means the 'Connector thread' in our
tutorial (http://mina.apache.org/configuring-thread-model.html).

> What is the timeout for?  Is the worker only active when connecting and the
> timeout a connection timeout?

No.  Connector thread exits itself when there's no connection attempts
in progress.  When it's implemented first, it exited immediately, and
it cause performance degradation when connection attempts occur
serially rather than simultaneously.  Giving some timeout before the
connector thread exits fixes the problem.  Actually we will get rid of
the worker timeout and take care of this problem using a Selector
pool.

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6