FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpp-taskflow/examples/dependent_async.cpp at master · EMinsight/cpp-taskflow · GitHub
EMinsight
/
cpp-taskflow
Public
forked from
taskflow/taskflow
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpp-taskflow
/
examples
/
dependent_async.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (19 loc) · 898 Bytes
Breadcrumbs
cpp-taskflow
/
examples
/
dependent_async.cpp
Copy path
File metadata and controls
30 lines (19 loc) · 898 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
include
<
taskflow/taskflow.hpp
>
//
the only include you need
int
main
(){
tf::Executor executor;
//
demonstration of dependent async (with future)
printf
(
"
Dependent Async
\n
"
);
auto
[A, fuA] = executor.
dependent_async
([](){
printf
(
"
A
\n
"
); });
auto
[B, fuB] = executor.
dependent_async
([](){
printf
(
"
B
\n
"
); }, A);
auto
[C, fuC] = executor.
dependent_async
([](){
printf
(
"
C
\n
"
); }, A);
auto
[D, fuD] = executor.
dependent_async
([](){
printf
(
"
D
\n
"
); }, B, C);
fuD.
get
();
//
demonstration of silent dependent async (without future)
printf
(
"
Silent Dependent Async
\n
"
);
A = executor.
silent_dependent_async
([](){
printf
(
"
A
\n
"
); });
B = executor.
silent_dependent_async
([](){
printf
(
"
B
\n
"
); }, A);
C = executor.
silent_dependent_async
([](){
printf
(
"
C
\n
"
); }, A);
D = executor.
silent_dependent_async
([](){
printf
(
"
D
\n
"
); }, B, C);
executor.
wait_for_all
();
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL