On Nov 7, 2006, at 10:14 AM, Sven Panko wrote:
After Peters remark I am still puzzled: is it better to rely onSocketAcceptor's default constructor (and do not specify executors/ socketio 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 endAnd - just out of curiosity - why does MINA use exactly 3 threads when Iuse 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
smime.p7s
Description: S/MIME cryptographic signature