| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f254d69 commit 3380a5f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,8 +30,8 @@ tf::Executor executor2(4); // create an executor of 4 worker threads | |||
| 30 | 30 | @endcode | |
| 31 | 31 | ||
| 32 | 32 | An executor can be reused to execute multiple taskflows. | |
| 33 | - In most workloads, you may need only one executor but multiple taskflows | ||
| 34 | - to represent parts of a parallel decomposition. | ||
| 33 | + In most workloads, you may need only one executor to run multiple taskflows | ||
| 34 | + where each taskflow represents a part of a parallel decomposition. | ||
| 35 | 35 | ||
| 36 | 36 | @section C2_ExecuteATaskflow Execute a Taskflow | |
| 37 | 37 | ||
@@ -57,7 +57,7 @@ The code below shows several ways to run a taskflow. | |||
| 57 | 57 | 11: A.precede(B, C); | |
| 58 | 58 | 12: | |
| 59 | 59 | 13: std::future<void> fu = executor.run(taskflow); | |
| 60 | - 14: fu.get(); // block until the execution completes | ||
| 60 | + 14: fu.wait(); // block until the execution completes | ||
| 61 | 61 | 15: | |
| 62 | 62 | 16: executor.run(taskflow, [](){ std::cout << "end of one execution\n"; }).get(); | |
| 63 | 63 | 17: executor.run_n(taskflow, 4); | |
@@ -76,8 +76,8 @@ Debrief: | |||
| 76 | 76 | @li Line 19 runs the taskflow four times and invokes a callback at the end of the forth execution | |
| 77 | 77 | @li Line 20 keeps running the taskflow until the predicate returns true | |
| 78 | 78 | ||
| 79 | - Issuing multiple runs on a same taskflow will automatically @em synchronize | ||
| 80 | - to a sequential chain of executions following the order of the run calls. | ||
| 79 | + Issuing multiple runs on the same taskflow will automatically @em synchronize | ||
| 80 | + to a sequential chain of executions in the order of run calls. | ||
| 81 | 81 | ||
| 82 | 82 | @code{.cpp} | |
| 83 | 83 | executor.run(taskflow); // execution 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | int main(){ | |
| 6 | 6 | ||
| 7 | - tf::Executor executor(0); | ||
| 7 | + tf::Executor executor; | ||
| 8 | 8 | ||
| 9 | 9 | // Create a taskflow of eight tasks | |
| 10 | 10 | tf::Taskflow taskflow; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments