Skip to content

Commit 3380a5f

Browse files
committed
updated observer example
1 parent f254d69 commit 3380a5f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

doxygen/cookbook/Chapter2.dox

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ tf::Executor executor2(4); // create an executor of 4 worker threads
3030
@endcode
3131

3232
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.
3535

3636
@section C2_ExecuteATaskflow Execute a Taskflow
3737

@@ -57,7 +57,7 @@ The code below shows several ways to run a taskflow.
5757
11: A.precede(B, C);
5858
12:
5959
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
6161
15:
6262
16: executor.run(taskflow, [](){ std::cout << "end of one execution\n"; }).get();
6363
17: executor.run_n(taskflow, 4);
@@ -76,8 +76,8 @@ Debrief:
7676
@li Line 19 runs the taskflow four times and invokes a callback at the end of the forth execution
7777
@li Line 20 keeps running the taskflow until the predicate returns true
7878

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.
8181

8282
@code{.cpp}
8383
executor.run(taskflow); // execution 1

example/observer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
int main(){
66

7-
tf::Executor executor(0);
7+
tf::Executor executor;
88

99
// Create a taskflow of eight tasks
1010
tf::Taskflow taskflow;

0 commit comments

Comments
 (0)