How to define one thread for multiple connections?

Christian Migowski chrismfwrd at gmail.com
Thu Nov 25 02:54:59 EST 2010


Hello,

On Thu, Nov 25, 2010 at 8:44 AM, hada <hadassa.koen at gmail.com> wrote:
>
> Hi all,
> The doc on NioServerSocketChannelFactory says:
> "One NioServerSocketChannelFactory can have one or more worker threads. A
> worker thread performs non-blocking read and write for one or more Channels
> in a non-blocking mode."
> this means that one thread is created per connection, and if the thread pool

this conclusion is not right - it says "one or MORE channels". If you
use the default way of creating the SocketChannelFactory, Netty
creates a reasonable amount of worker threads (i think it equals the
number of cores, but I may be wrong) that handle all incoming
connections - no matter if 1, 500 or more (500 are no problem at all).

christian

> can't add a new thread for a new connection, the connection is not
> esthablished.
> I need one server with about 500 clients connected (and any disconnection
> should occurs).
> The problem is that I want to minimize the number of thread in my process.
> How can I define only one thread that responsible to manage many
> connections?
>
> thanks!
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/How-to-define-one-thread-for-multiple-connections-tp5773292p5773292.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