Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boss线程数好像设置有误 #9

Closed
cjqCN opened this issue Sep 25, 2018 · 1 comment · Fixed by #10
Closed

Boss线程数好像设置有误 #9

cjqCN opened this issue Sep 25, 2018 · 1 comment · Fixed by #10
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@cjqCN
Copy link

cjqCN commented Sep 25, 2018

Boss线程数好像设置有误
private static final int BOSS_SIZE = Runtime.getRuntime().availableProcessors() * 2; private static EventLoopGroup boss = new NioEventLoopGroup(BOSS_SIZE);

Netty 的服务器端的 acceptor 阶段, 没有使用到多线程,
服务器端的 ServerSocketChannel 只绑定到了 bossGroup 中的一个线程, 在调用 Java NIO 的 Selector.select 处理客户端的连接请求时, 实际上是在一个线程中的, 所以对只有一个服务的应用来说, bossGroup 设置多个线程是没有什么作用的

@crossoverJie
Copy link
Member

@cjqCN

You are right and have been fixed.

#10

@crossoverJie crossoverJie added bug Something isn't working good first issue Good for newcomers labels Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants