8000 CPU高占用 · Issue #45 · CodingHanYa/workspace · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

CPU高占用 #45

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
mydsyc opened this issue Apr 11, 2025 · 2 comments
Open

CPU高占用 #45

mydsyc opened this issue Apr 11, 2025 · 2 comments

Comments

@mydsyc
Copy link
mydsyc commented Apr 11, 2025

我的CPU是四核,创建workbrach对象的时候会导致CPU高占用

#include <workspace/workspace.hpp>
int main() {
    wsp::workbranch br;
    sleep(10);
}

Image

@CodingHanYa
Copy link
Owner

目前策略是快速创建快速销毁

@Daveshammer
Copy link
Contributor

应该是忙等待导致的CPU占用高(worker线程在空闲时不停的yield),对延迟不敏感可以把yield改成std::this_thread::sleep_for(std::chrono::milliseconds(1));试试

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

3 participants
0