Can you please explain how Netty uses thread pools to work? Do I understand correctly, that there are two kinds of thread-pools: boss and worker. Boss ones are used to do I/O an
Description related to Netty Nio implementation (3.2.4.Final) NioServerSocketChannelFactory.
The worker thread pool has to be able to deliver at least Number of Workers threads (currently default 2*number of cores).
Why?
In case of this implementation each worker has his own selector loop, this means that each worker will "eat up" one thread to sleep on the selector. Also that worker (and associated thread) is responsible for doing all the actual writes and reads (including fireing events on the pipeline, that means handlers are executed in that workers thread).
In case of the boss thread pool, actually the thread pool is unneeded because current implementation acquires only a single thread from it. That thread sleeps on the selector for server socket most of the time, after accepting connection that connection is registered with a worker. From that moment on worker is responsible for serving that connection.