Comments (3)
已支持 commit 2e0c5e8
from threadpool.
很开心看到您的回复。 我前段时间,也实现了一个可以自动缩扩容的C++的线程池,跟大佬分享。
主要思路,是记录分主辅线程,并且在设定 ttl 内空闲,则释放辅助线程。
也请大佬帮忙review一下:
https://github.com/ChunelFeng/CGraph/blob/main/tutorial/TU01-ThreadPool.cpp
from threadpool.
我觉得, 初始1~2个线程,开启自动增长, 空闲自动释放应该也不错吧, 省一个监控线程
from threadpool.
Related Issues (20)
- addThread 工作线程函数97行99行
- 请问怎么循环实现,执行线程池中的几个线程 HOT 1
- AUTO_GROW的线程大多时候创建完就退出了 HOT 1
- threadpool初始化就抛出异常了 HOT 1
- 在只剩下一个空闲线程时,多个任务同时commit, 会发生什么? HOT 2
- 子线程返回方式矛盾 HOT 1
- 发现一个BUG
- ‘bind’ was not declared in this scope HOT 1
- thread pool 与 numactl 同时使用,出现捕获不到commit的tasks HOT 1
- 自动增长锁,必须有AUTO_GROW宏才会定义,但是在ifndef的判断后使用了它 HOT 3
- 长时间运行后Threadpool为什么会变慢? HOT 1
- 关于 auto task = std::make_shared<std::packaged_task<ResType()>>(std::bind(std::forward<F>(f), std::forward<Args>(args)...) ); HOT 1
- 向 namespace std 添加内容是ub
- 你真的有运行过你的代码吗? HOT 1
- 显示 未定义标识符 "_lockGrow"
- error: no instance of function template "std::threadpool::commit" matches the argument list HOT 1
- idlThrNum是原子变量,是否不需要加锁? HOT 1
- 发现一个bug HOT 3
- 关于自动释放线程的一个问题
- 单例模式
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from threadpool.