On Nov 7, 2006, at 10:14 AM, Sven Panko wrote:
After Peters remark I am still puzzled: is it better to rely on
SocketAcceptor's default constructor (and do not specify executors/ socket
io processors at all) or can I go with this for the dual processor
machine?

--- snip start
Executor executor = Executors.newCachedThreadPool();
SocketAcceptor acceptor = new SocketAcceptor(2, executor);
--- snip end

--- quote start
The above example will only use 3 threads from the pool.
1 for accepting, and 2 for the processing of existing connection.
--- quote end

And - just out of curiosity - why does MINA use exactly 3 threads when I
use this construct?

--- snip start
Executor executor1 = Executors.newFixedThreadPool(10);
SocketAcceptor acceptor = new SocketAcceptor(2, executor1);
--- snip end

the SocketAcceptor is going to use a certain number of threads, based on the first parameter.

The Executor is just there for it to get the threads its going to use. You could use a 'NewThreadExecutor()' if you don't want to worry about pool sizing. Its an Executor implementation that just launches a new thread.

-pete


--
[EMAIL PROTECTED] - http://fotap.org/~osi



Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to