Hi Trustin, sorry for messing up your name last time...
Ok, so assuming I use MINA 2.0 (probably the best option) I found some code
you had posted previously...
SocketAcceptor acceptor = new NioSocketAcceptor();
acceptor.getFilterChain().addLast("executor", new ExecutorFilter(
new UnorderedThreadPoolExecutor( 0, 16, 30, TimeUnit.SECONDS,
new IoEventQueueThrottle())));
acceptor.setHandler(new IoHandlerAdapter() {
@Override
public void messageReceived(IoSession session, Object message)
throws Exception {
Thread.sleep(1000);
}
});
acceptor.setLocalAddress(new InetSocketAddress(1234));
acceptor.bind();
So I just want to make sure I'm reading this right, your adding the
UnorderedThreadPoolExecutor to the NioSocketAcceptor which will create new
threads as needed to a maximum of 16. Your adding a handler to the Acceptor
which I assume could be any class that extends IoHandlerAdapter. So if
there's alot of traffic, instances of the IoHandlerAdapter will be called
into service as needed? Is there any rule of thumb for corePoolSize and
maximumPoolSize? I'm a little shady regarding the keepAliveTime and
IoEventQueueThrottle() still too...
--
View this message in context:
http://www.nabble.com/Question-regarding-threading-tf4827942s16868.html#a13844579
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.