Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efb2f70

Browse files
author
twhuang
committed
updated worker interface
1 parent 96620cc commit efb2f70

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

doxygen/contributing/contributors.dox

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ We are grateful for the following organizations and projects that are using %Tas
9797
@li <a href="https://github.com/maxbachmann/RapidFuzz">RapidFuxx</a>: Rapid fuzzy string matching in Python using various string metrics
9898
@li <a href="https://github.com/KomodoPlatform/atomicDEX-Desktop">AtomicDEX</a>: Secure wallet and decentralized exchange rolled into one application
9999
@li <a href="https://github.com/intel-ai/oox">OOX</a>: Out-of-order task execution library in modern C++
100-
@li <a href="https://reagent.ai/">ReAgent</a>: An open end-to-end platform for applied reinforcement learning developed and used at Facebook.
100+
@li <a href="https://reagent.ai/">ReAgent</a>: An open end-to-end platform for applied reinforcement learning developed and used at Facebook
101+
@li <a href="https://github.com/GauravDawra/Beast">Beast-Build</a>: A build system built for speed and power
101102

102103
... more at [GitHub](https://github.com/search?q=taskflow&type=Code).
103104

doxygen/releases/release-3.5.0.dox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ To use %Taskflow v3.5.0, you need a compiler that supports C++17:
5151
@section release-3-5-0_bug_fixes Bug Fixes
5252

5353
+ Fixed the compilation error in the graph pipeline benchmark
54+
+ Fixed the compilation error in unknown OS (replaced with @c TF_OS_UNKNOWN)
5455

5556
If you encounter any potential bugs, please submit an issue at @IssueTracker.
5657

examples/worker_interface.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ class CustomWorkerBehavior : public tf::WorkerInterface {
88
public:
99

1010
// to call before the worker enters the scheduling loop
11-
void scheduler_prologue(tf::Worker& wv) override {
12-
std::cout << tf::stringify("worker ", wv.id(), " enters the scheduler loop\n");
11+
void scheduler_prologue(tf::Worker& w) override {
12+
std::cout << tf::stringify(
13+
"worker ", w.id(), " (native=", w.thread()->native_handle(), ") enters scheduler\n"
14+
);
1315
}
1416

1517
// to call after the worker leaves the scheduling loop
16-
void scheduler_epilogue(tf::Worker& wv, std::exception_ptr) override {
17-
std::cout << tf::stringify("worker ", wv.id(), " leaves the scheduler loop\n");
18+
void scheduler_epilogue(tf::Worker& w, std::exception_ptr) override {
19+
std::cout << tf::stringify(
20+
"worker ", w.id(), " (native=", w.thread()->native_handle(), ") leaves scheduler\n"
21+
);
1822
}
19-
2023
};
2124

2225
int main() {

taskflow/core/executor.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,9 +1198,7 @@ inline void Executor::_schedule(Node* node) {
11981198
}
11991199

12001200
// Procedure: _schedule
1201-
inline void Executor::_schedule(
1202-
Worker& worker, const SmallVector<Node*>& nodes
1203-
) {
1201+
inline void Executor::_schedule(Worker& worker, const SmallVector<Node*>& nodes) {
12041202

12051203
// We need to cacth the node count to avoid accessing the nodes
12061204
// vector while the parent topology is removed!
@@ -1449,7 +1447,8 @@ inline void Executor::_tear_down_invoke(Worker& worker, Node* node) {
14491447
_tear_down_topology(worker, node->_topology);
14501448
}
14511449
}
1452-
else { // joined subflow
1450+
// joined subflow
1451+
else {
14531452
node->_parent->_join_counter.fetch_sub(1);
14541453
}
14551454
}

taskflow/utility/os.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
TF_OS_LINUX + TF_OS_DRAGONFLY + TF_OS_FREEBSD + TF_OS_NETBSD + \
8181
TF_OS_OPENBSD + TF_OS_DARWIN + TF_OS_WINDOWS + TF_OS_HURD + \
8282
TF_OS_SOLARIS)
83-
#error Unknown OS
83+
#define TF_OS_UNKNOWN 1
8484
#endif
8585

8686
#if TF_OS_LINUX || TF_OS_DRAGONFLY || TF_OS_FREEBSD || TF_OS_NETBSD || \

0 commit comments

Comments
 (0)