mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frédéric Brégier <fred.breg...@free.fr>
Subject Re: Thread pools setup and behavior with MINA 1.0.0
Date Fri, 27 Oct 2006 13:05:02 GMT
If you specify newFixedThreadPool, then you have a pool of thread
limited to the number you specified (here 16).
Perhaps MINA takes one thread for itself, so you have at least
15 threads (maybe 16) that are available for clients,
specifically for the first thread spool (socketAcceptor).

So what you want is probably to use newCachedThreadPool
which enables the system to create as many threads it needs
but caching these threads in spool so that threads becomes faster ready
to run another task.

By default, Mina does not set a 16 thread pool for socketAcceptor.
In fact, the first level (socketAcceptor) is something
similar to newCachedThreadPool as it creates new thread
each time it is needed. The main difference here with
newCachedThreadPool is that dead thread will never
be used again.
So setting newCachedThreadPool should be better
than native way in Mina for socketAcceptor.

In the filter Chain, there is by default a 16 threads pool
in Mina, as a FixedThreadPool should do.
You should be able to choose either Fixed or Cached here
if you want to set up your own thread pool.

Frederic
----- Original Message ----- 
In Setup #2 when I fire up 16 clients to connect and send a bunch of
messages, it seems the 16th clients has to wait for one ioSession to be
closed before being able to go through.

What am I doing wrong here?
I want to use the manual setup to be able to configure the number of
threads used for the acceptor and the filter chain.

Thx in advance.

-- 
Frederic Soulier <frederic@wallaby.uklinux.net>
OpenPGP key available on http://www.keyserver.net
1024D/BA6700ED   49A6 8E8E 4230 8D41 1ADE  B649 3203 1DD2 BA67 00ED



Mime
View raw message