Comments (3)
没有维护一个全局任务数,所以线程也无法知道其它线程是否还有任务,只能先去搜索。如果没搜索到,再通知CPU切换到其它线程执行。
from workspace.
void waitForTasks() {
for (int i = 0; i < thread_numb; ++i) {
threads[i].waitTasksDone();
}
for (int i = 0; i < thread_numb; ++i) {
threads[i].cleanWaitingFlag();
}
}
对这段代码我的理解是:如果某个线程的waiting==false,那么该pond的所有线程的任务数已经为0了。那么怎么去偷窃呢?
from workspace.
我不太能理解你想表达的 { '_' }
from workspace.
Related Issues (20)
- 稳定性测试脚本的问题 HOT 1
- ubuntu 20下,起进程,这个进程无法关闭 HOT 1
- 请问线程池可以处理高递归的任务吗 HOT 1
- 关于任务窃取机制的疑问 HOT 3
- 关于submitForReturn函数是否能执行带参数的函数的问题 HOT 3
- 卧槽,名字都改掉了 HOT 1
- 建议启用以下cmake功能 HOT 1
- 在Issues中看到了有对应的b站视频,up主能否挂一下链接 HOT 1
- 请教关于workspace HOT 3
- CMakeLists.txt有点问题 HOT 6
- 知乎上看到说这个库还有对应的解析视频?不知道哪里可以看到? HOT 1
- 重构问题 HOT 2
- workbranch::mission里访问workbranch::decline不用加锁吗? HOT 1
- 请求一些意见
- 线程返回超时问题 HOT 2
- 关于win 中引用当前workspace库 使用c++14报错的问题 HOT 4
- 如何取消指定任务? HOT 1
- 空载时CPU占用巨高 HOT 1
- Futures类成员函数返回临时变量的引用 HOT 1
- 动态线程调整相关 HOT 1
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 workspace.