我们是否需要一个以上的老板组线程? [英] do we need more than a single thread for boss group?

查看:68
本文介绍了我们是否需要一个以上的老板组线程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意思是NioEventLoopGroup(threadsAmount)构造函数的一个参数.如果我理解得很好,那么我们需要多个线程来接受传入连接的情况就很少见了.

I mean an argument of NioEventLoopGroup(threadsAmount) constructor. If I understand this well, situations where we need more than one thread to accept incoming connections, are exceptionally rare.

在哪种情况下,我们需要一个以上的线程来接受传入的连接?我在想,也许什么时候连接处理程序很轻巧,寿命很短.

In what kind of situations would we need more than one thread to accept incoming connections? I was thinking of maybe when the connections handlers are light and extremely short-living.

推荐答案

通常,如果您在不同的ServerBoostrap之间共享NioEventLoopGroup.

Mostly if you share the NioEventLoopGroup between different ServerBoostraps.

这篇关于我们是否需要一个以上的老板组线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆