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

大佬,能否支持一下空闲线程自动释放? #10

Closed
ChunelFeng opened this issue Apr 30, 2021 · 3 comments
Closed

大佬,能否支持一下空闲线程自动释放? #10

ChunelFeng opened this issue Apr 30, 2021 · 3 comments

Comments

@ChunelFeng
Copy link

rt

@lzpong
Copy link
Owner

lzpong commented Jun 2, 2022

已支持 commit 2e0c5e8

@lzpong lzpong closed this as completed Jun 2, 2022
@ChunelFeng
Copy link
Author

ChunelFeng commented Jun 2, 2022

很开心看到您的回复。 我前段时间,也实现了一个可以自动缩扩容的C++的线程池,跟大佬分享。
主要思路,是记录分主辅线程,并且在设定 ttl 内空闲,则释放辅助线程。

也请大佬帮忙review一下:
https://github.com/ChunelFeng/CGraph/blob/main/tutorial/TU01-ThreadPool.cpp

@lzpong
Copy link
Owner

lzpong commented Jun 9, 2022

我觉得, 初始1~2个线程,开启自动增长, 空闲自动释放应该也不错吧, 省一个监控线程

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