8000 请问ums与fiber一样只能使用一个核心吗? · Issue #1 · zhangpf/cloud-demos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

请问ums与fiber一样只能使用一个核心吗? #1

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

Open
Junotja opened this issue Oct 25, 2018 · 2 comments
Open

请问ums与fiber一样只能使用一个核心吗? #1

Junotja opened this issue Oct 25, 2018 · 2 comments

Comments

@Junotja
Copy link
Junotja commented Oct 25, 2018

我测试之后发现,ums与fiber一样仅能使用一个核心进行处理,而thread可以写满cpu,是有什么特殊设置吗?https://docs.microsoft.com/zh-cn/windows/desktop/ProcThread/user-mode-scheduling中提到“efficiently run many threads concurrently on multiprocessor or multicore systems”。看上去应该是可以的吧?

@zhangpf
Copy link
Owner
zhangpf commented Oct 25, 2018

AFAIK, UMS can only utilize a single CPU at any time. It has the similar model as other lightweight thread libraries, except that it has system thread context. To support multicore, I think you can:

  1. Use a thread pool, while in each thread, separate UMS is applied.
  2. Choose another N:M thread model runtime, like go-runtime.

If you find a better method for UMS utilizes multicore, please tell me. Thanks.

@Junotja
Copy link
Author
Junotja commented Oct 30, 2018

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
0