Hi Rob,
On 5/16/07, Rob Butler <[EMAIL PROTECTED]> wrote:
Hello all,
I'm a bit confused with SocketAcceptor( int processorCount, Executor executor ).
Internally this creates a new SocketIoProcessor for each processorCount. But
the SocketIoProcessors all share the same Executor. What's the advantage of
having multiple instances of SocketIoProcessor?
It will perform much better with multi-core CPUs.
If you use a pooling Executor like Executors.newCachedThreadPool() or
Executors.newFixedThreadPool(int nThreads) is this creating a new thread for
each connection?
Never. The 'processor' here means a SocketIoProcessor, which performs
I/O for you. It doesn't have any relationship with business logic or
event thread pool.
How does this relate to an ExecutorFilter in the IoHandlerChain?
No relationship. They are different things.
If I want a few IO processing threads, which re-use threads from a pool, and
worker threads which use a separate pool what is the best way to do this? I
don't want a thread per connection.
* A few I/O processing threads: can be specified as a SocketAcceptor
constructor parameter.
* worker thread pool: add an executor filter.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6