Worker threads in NioServerSocketChannelFactory vs. ExecutionHandler

Norman Maurer norman.maurer at googlemail.com
Sun Jun 19 02:23:23 EDT 2011


As far as I remember you should not use a FixedThreadPool with netty.
Just use a cached one and use the workercount to specify it. I think
it is because of how netty use the pool internal...


bye
norman


Am Samstag, 18. Juni 2011 schrieb Ersin Er <ersin.er at gmail.com>:
> One more related question:
> Considering the following constructor:
> public NioServerSocketChannelFactory(            Executor bossExecutor, Executor workerExecutor,
>
>             int workerCount)
> How is workerCount ad workerExecutor (and its pool size) related? Isn't the number of I/O worker threads fixed by the workerExecutor? What happens if I pass a Executors.newFixedThreadPool(8) as workerThreads to this constructor?
>
>
> Thanks again,
> On Sun, Jun 19, 2011 at 00:03, Ersin Er <ersin.er at gmail.com> wrote:
> Well, I guess I could not ask the question the right way. Actually by digging more into documentation and source code I think I understood the difference. Anyway let me restate what I understood:
>
>
> There are two types of "worker" thread pools in Netty. First one (set in NioServerSocketChannelFactory constructor ) is responsible for doing I/O operations and the second one (added as a handler to the pipeline, namely ExecutionHandler) is responsible for application logic. Right?
>
>
>
> Thanks.
> On Sat, Jun 18, 2011 at 17:52, "이희승 (Trustin Lee)" <trustin at gmail.com> wrote:
> The first one is used for boss threads and the second one is for worker threads.  A worker thread performs actual reads and writes.  A boss thread accepts a new incoming connection or makes a new connection attempt.  Once a new connection is accepted or a connection attempt succeeds, the new channel is handed off to one of the worker threads.  For now, there's no way to set the boss thread count.
>
> HTH
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
>
> --
> Ersin Er
>
>
>
> --
> Ersin Er
>
>



More information about the netty-users mailing list