Shared thread pools for multiple server sockets?
Norman Maurer
norman.maurer at googlemail.com
Sun Jun 19 02:25:05 EDT 2011
I think I remember that you should use a CachedThreadPool all the
time. Thats because of netty internals..
bye
norman
Am Sonntag, 19. Juni 2011 schrieb GoldenKevin <goldstar.kevin at gmail.com>:
> I have been refactoring a lot of the code for my application. I have multiple
> NioServerSocketChannelFactory instances that all listen on different ports,
> and each uses its own worker thread pool. The listeners on each port all
> receive similar loads and perform similar tasks, so I figured it would be
> more efficient if they were to share a single worker thread pool so that
> there would be fewer idling threads.
>
> Now, say I passed a number 'n' for the parameter workerCount in the
> NioServerSocketChannelFactory constructor, and I run 'm' instances of
> NioServerSocketChannelFactory. When creating a fixed size thread pool,
> should I call Executors.newFixedThreadPool(n) or
> Executors.newFixedThreadPool(m * n)? Or would it be wiser just to call
> Executors.newCachedThreadPool() instead?
>
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Shared-thread-pools-for-multiple-server-sockets-tp6491909p6491909.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
More information about the netty-users
mailing list