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

server的主loop相关问题 #40

Closed
M6ZeroG opened this issue Sep 6, 2020 · 1 comment
Closed

server的主loop相关问题 #40

M6ZeroG opened this issue Sep 6, 2020 · 1 comment

Comments

@M6ZeroG
Copy link

M6ZeroG commented Sep 6, 2020

注意到Listener被单独放置在server.loop里形成一个只包含一个fd的event-loop,这样比起将Listener放置在单独协程里阻塞的Accept并派发TCP连接到各个子event-loop里的方式有什么优势,仅仅是为了保证纯异步非阻塞吗:laughing:,请教。

@Allenxuxu
Copy link
Owner

在 go 里,似乎两种方式差别不大。具体有没有优势可能需要对比测试下,这和golang底层的协程调度有关。

@M6ZeroG M6ZeroG closed this as completed Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants