Skip to content

Commit 4384863

Browse files
committed
Add Framework
1 parent 67fc5c1 commit 4384863

254 files changed

Lines changed: 3692 additions & 1043 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/Cookbook.html

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
66
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
7-
<meta name="generator" content="Doxygen 1.8.13"/>
7+
<meta name="generator" content="Doxygen 1.8.16"/>
88
<meta name="viewport" content="width=device-width, initial-scale=1"/>
99
<title>Cpp-Taskflow</title>
1010
<link href="tabs.css" rel="stylesheet" type="text/css"/>
@@ -16,13 +16,16 @@
1616
<script type="text/javascript" src="navtreedata.js"></script>
1717
<script type="text/javascript" src="navtree.js"></script>
1818
<script type="text/javascript">
19+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
1920
$(document).ready(initResizable);
20-
</script>
21+
/* @license-end */</script>
2122
<link href="search/search.css" rel="stylesheet" type="text/css"/>
2223
<script type="text/javascript" src="search/searchdata.js"></script>
2324
<script type="text/javascript" src="search/search.js"></script>
2425
<script type="text/javascript">
26+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
2527
$(document).ready(function() { init_search(); });
28+
/* @license-end */
2629
</script>
2730
<link href="doxygen.css" rel="stylesheet" type="text/css" />
2831
</head>
@@ -57,9 +60,11 @@
5760
</table>
5861
</div>
5962
<!-- end header part -->
60-
<!-- Generated by Doxygen 1.8.13 -->
63+
<!-- Generated by Doxygen 1.8.16 -->
6164
<script type="text/javascript">
65+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
6266
var searchBox = new SearchBox("searchBox", "search",false,'Search');
67+
/* @license-end */
6368
</script>
6469
</div><!-- top -->
6570
<div id="side-nav" class="ui-resizable side-nav-resizable">
@@ -73,7 +78,9 @@
7378
</div>
7479
</div>
7580
<script type="text/javascript">
81+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
7682
$(document).ready(function(){initNavTree('Cookbook.html','');});
83+
/* @license-end */
7784
</script>
7885
<div id="doc-content">
7986
<!-- window showing the filter options -->
@@ -90,7 +97,7 @@
9097
</iframe>
9198
</div>
9299

93-
<div class="header">
100+
<div class="PageDoc"><div class="header">
94101
<div class="headertitle">
95102
<div class="title">Cookbook </div> </div>
96103
</div><!--header-->
@@ -103,15 +110,17 @@
103110
<a class="el" href="chapter4.html">C4: Create a Parallel Reduction Graph</a> <br />
104111
<a class="el" href="chapter5.html">C5: Spawn Task Dependency Graphs at Runtime</a> <br />
105112
<a class="el" href="chapter6.html">C6: Manage Threads and Executor</a> <br />
113+
<a class="el" href="chapter7.html">C7: Framework (Experimental)</a> <br />
106114
</p>
107-
</div></div><!-- contents -->
115+
</div></div><!-- PageDoc -->
116+
</div><!-- contents -->
108117
</div><!-- doc-content -->
109118
<!-- start footer part -->
110119
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
111120
<ul>
112121
<li class="footer">Generated by
113122
<a href="http://www.doxygen.org/index.html">
114-
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
123+
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.16 </li>
115124
</ul>
116125
</div>
117126
</body>

docs/Cookbook.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,12 @@ var Cookbook =
5050
[ "Customize Your Executor Interface", "chapter6.html#C6CustomizeYourExecutorInterface", null ],
5151
[ "Thread Safety", "chapter6.html#C6ThreadSafety", null ],
5252
[ "Example 1: Impact of Over-subscription", "chapter6.html#C6Example1", null ]
53+
] ],
54+
[ "C7: Framework (Experimental)", "chapter7.html", [
55+
[ "Create a Framework", "chapter7.html#C7_CreateAFramework", null ],
56+
[ "Execute a Framework", "chapter7.html#C7_ExecuteAFramework", null ],
57+
[ "Lifetime of a Framework", "chapter7.html#C7_LifeTimeOfAFramework", null ],
58+
[ "Create an Application Framework", "chapter7.html#C7_CreateAppicationFramework", null ],
59+
[ "Caveats", "chapter7.html#C7_Caveats", null ]
5360
] ]
5461
];

docs/Doxyfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ INPUT = ../taskflow/taskflow.hpp \
812812
../taskflow/graph/flow_builder.hpp \
813813
../taskflow/graph/basic_taskflow.hpp \
814814
../taskflow/graph/task.hpp \
815+
../taskflow/graph/framework.hpp \
815816
../taskflow/threadpool/simple_threadpool.hpp \
816817
../taskflow/threadpool/proactive_threadpool.hpp \
817818
../taskflow/threadpool/speculative_threadpool.hpp \
@@ -825,6 +826,7 @@ INPUT = ../taskflow/taskflow.hpp \
825826
cookbook/Chapter4.dox \
826827
cookbook/Chapter5.dox \
827828
cookbook/Chapter6.dox \
829+
cookbook/Chapter7.dox \
828830
FAQ.dox \
829831
header.html
830832

docs/FAQ.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
66
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
7-
<meta name="generator" content="Doxygen 1.8.13"/>
7+
<meta name="generator" content="Doxygen 1.8.16"/>
88
<meta name="viewport" content="width=device-width, initial-scale=1"/>
99
<title>Cpp-Taskflow</title>
1010
<link href="tabs.css" rel="stylesheet" type="text/css"/>
@@ -16,13 +16,16 @@
1616
<script type="text/javascript" src="navtreedata.js"></script>
1717
<script type="text/javascript" src="navtree.js"></script>
1818
<script type="text/javascript">
19+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
1920
$(document).ready(initResizable);
20-
</script>
21+
/* @license-end */</script>
2122
<link href="search/search.css" rel="stylesheet" type="text/css"/>
2223
<script type="text/javascript" src="search/searchdata.js"></script>
2324
<script type="text/javascript" src="search/search.js"></script>
2425
<script type="text/javascript">
26+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
2527
$(document).ready(function() { init_search(); });
28+
/* @license-end */
2629
</script>
2730
<link href="doxygen.css" rel="stylesheet" type="text/css" />
2831
</head>
@@ -57,9 +60,11 @@
5760
</table>
5861
</div>
5962
<!-- end header part -->
60-
<!-- Generated by Doxygen 1.8.13 -->
63+
<!-- Generated by Doxygen 1.8.16 -->
6164
<script type="text/javascript">
65+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
6266
var searchBox = new SearchBox("searchBox", "search",false,'Search');
67+
/* @license-end */
6368
</script>
6469
</div><!-- top -->
6570
<div id="side-nav" class="ui-resizable side-nav-resizable">
@@ -73,7 +78,9 @@
7378
</div>
7479
</div>
7580
<script type="text/javascript">
81+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
7682
$(document).ready(function(){initNavTree('FAQ.html','');});
83+
/* @license-end */
7784
</script>
7885
<div id="doc-content">
7986
<!-- window showing the filter options -->
@@ -90,7 +97,7 @@
9097
</iframe>
9198
</div>
9299

93-
<div class="header">
100+
<div class="PageDoc"><div class="header">
94101
<div class="headertitle">
95102
<div class="title">Frequently Asked Questions </div> </div>
96103
</div><!--header-->
@@ -112,7 +119,8 @@ <h2><a class="anchor" id="GeneralQuestion4"></a>
112119
<p>Benchmarks showed Cpp-Taskflow can efficiently handle millions or billions of tasks (both large and small tasks) on a machine with up to 64 CPUs.</p>
113120
<h2><a class="anchor" id="GeneralQuestion5"></a>
114121
Q5: What is the weird hex value, like 0x7fc39d402ab0, in the dumped graph?</h2>
115-
<p>The hex value represents the memory address of the task. Each task has a method <a class="el" href="classtf_1_1Task.html#a9057ecd0f3833b717480e914f8568f02" title="assigns a name to the task ">tf::Task::name(const std::string&amp;)</a> for user to assign a human readable string to ease the debugging process. If a task is not assigned a name or is an internal node, its address value in the memory is used instead. </p><hr/>
122+
<p>The hex value represents the memory address of the task. Each task has a method <a class="el" href="classtf_1_1Task.html#a9057ecd0f3833b717480e914f8568f02" title="assigns a name to the task">tf::Task::name(const std::string&amp;)</a> for user to assign a human readable string to ease the debugging process. If a task is not assigned a name or is an internal node, its address value in the memory is used instead.</p>
123+
<hr/>
116124
<h1><a class="anchor" id="ProgrammingQuestions"></a>
117125
Programming Questions</h1>
118126
<h2><a class="anchor" id="ProgrammingQuestions1"></a>
@@ -127,21 +135,22 @@ <h2><a class="anchor" id="ProgrammingQuestions3"></a>
127135
<p>No, the taskflow object is not thread-safe. You can't create tasks from multiple threads at the same time.</p>
128136
<h2><a class="anchor" id="ProgrammingQuestions4"></a>
129137
Q4: My program hangs and never returns after dispatching a taskflow graph. What's wrong?</h2>
130-
<p>When the program hangs forever it is very likely your taskflow graph has a cycle. Try the <a class="el" href="classtf_1_1BasicTaskflow.html#adac448e1cc44307856b3116d7ed5490f" title="dumps the present task dependency graph to a std::ostream in DOT format ">tf::Taskflow::dump</a> method to debug the graph before dispatching your taskflow graph.</p>
138+
<p>When the program hangs forever it is very likely your taskflow graph has a cycle. Try the <a class="el" href="classtf_1_1BasicTaskflow.html#adac448e1cc44307856b3116d7ed5490f" title="dumps the present task dependency graph to a std::ostream in DOT format">tf::Taskflow::dump</a> method to debug the graph before dispatching your taskflow graph.</p>
131139
<h2><a class="anchor" id="ProgrammingQuestions5"></a>
132140
Q5: In the following example where B spawns a joined subflow of two tasks B1 and B2, do they run concurrently with task A?</h2>
133141
<div class="image">
134-
<img src="dynamic_graph.png" alt="dynamic_graph.png" width="60%"/>
142+
<img src="dynamic_graph.png" alt="" width="60%"/>
135143
</div>
136144
<p>No. The subflow is spawned during the execution of B, and at this point A must finish because A precedes B. This gives rise to the fact B1 and B2 must run after A. This graph may looks strange because B seems to run twice! However, Cpp-Taskflow will schedule B only once to create its subflow. Whether this subflow joins or detaches from B only affects the future object returned from B. </p>
137-
</div></div><!-- contents -->
145+
</div></div><!-- PageDoc -->
146+
</div><!-- contents -->
138147
</div><!-- doc-content -->
139148
<!-- start footer part -->
140149
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
141150
<ul>
142151
<li class="footer">Generated by
143152
<a href="http://www.doxygen.org/index.html">
144-
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
153+
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.16 </li>
145154
</ul>
146155
</div>
147156
</body>

docs/annotated.html

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
66
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
7-
<meta name="generator" content="Doxygen 1.8.13"/>
7+
<meta name="generator" content="Doxygen 1.8.16"/>
88
<meta name="viewport" content="width=device-width, initial-scale=1"/>
99
<title>Cpp-Taskflow</title>
1010
<link href="tabs.css" rel="stylesheet" type="text/css"/>
@@ -16,13 +16,16 @@
1616
<script type="text/javascript" src="navtreedata.js"></script>
1717
<script type="text/javascript" src="navtree.js"></script>
1818
<script type="text/javascript">
19+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
1920
$(document).ready(initResizable);
20-
</script>
21+
/* @license-end */</script>
2122
<link href="search/search.css" rel="stylesheet" type="text/css"/>
2223
<script type="text/javascript" src="search/searchdata.js"></script>
2324
<script type="text/javascript" src="search/search.js"></script>
2425
<script type="text/javascript">
26+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
2527
$(document).ready(function() { init_search(); });
28+
/* @license-end */
2629
</script>
2730
<link href="doxygen.css" rel="stylesheet" type="text/css" />
2831
</head>
@@ -57,9 +60,11 @@
5760
</table>
5861
</div>
5962
<!-- end header part -->
60-
<!-- Generated by Doxygen 1.8.13 -->
63+
<!-- Generated by Doxygen 1.8.16 -->
6164
<script type="text/javascript">
65+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
6266
var searchBox = new SearchBox("searchBox", "search",false,'Search');
67+
/* @license-end */
6368
</script>
6469
</div><!-- top -->
6570
<div id="side-nav" class="ui-resizable side-nav-resizable">
@@ -73,7 +78,9 @@
7378
</div>
7479
</div>
7580
<script type="text/javascript">
81+
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
7682
$(document).ready(function(){initNavTree('annotated.html','');});
83+
/* @license-end */
7784
</script>
7885
<div id="doc-content">
7986
<!-- window showing the filter options -->
@@ -101,13 +108,14 @@
101108
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1BasicTaskflow.html" target="_self">BasicTaskflow</a></td><td class="desc">The base class to derive a taskflow class </td></tr>
102109
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="structtf_1_1Error.html" target="_self">Error</a></td><td class="desc">The error category of taskflow </td></tr>
103110
<tr id="row_0_2_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1FlowBuilder.html" target="_self">FlowBuilder</a></td><td class="desc">The building blocks of task dependency graphs </td></tr>
104-
<tr id="row_0_3_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1ProactiveThreadpool.html" target="_self">ProactiveThreadpool</a></td><td class="desc">Executor that implements a centralized task queue with a proactive execution strategy </td></tr>
105-
<tr id="row_0_4_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1SimpleThreadpool.html" target="_self">SimpleThreadpool</a></td><td class="desc">Executor that implements a centralized task queue with a simple execution strategy </td></tr>
106-
<tr id="row_0_5_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1SpeculativeThreadpool.html" target="_self">SpeculativeThreadpool</a></td><td class="desc">Executor that implements a centralized task queue with a speculative execution strategy </td></tr>
107-
<tr id="row_0_6_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1SubflowBuilder.html" target="_self">SubflowBuilder</a></td><td class="desc">The building blocks of dynamic tasking </td></tr>
108-
<tr id="row_0_7_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Task.html" target="_self">Task</a></td><td class="desc">Handle to modify and access a task </td></tr>
109-
<tr id="row_0_8_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1WorkStealingQueue.html" target="_self">WorkStealingQueue</a></td><td class="desc">Lock-free unbounded single-producer multiple-consumer queue </td></tr>
110-
<tr id="row_0_9_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1WorkStealingThreadpool.html" target="_self">WorkStealingThreadpool</a></td><td class="desc">Executor that implements an efficient work stealing algorithm </td></tr>
111+
<tr id="row_0_3_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Framework.html" target="_self">Framework</a></td><td class="desc"></td></tr>
112+
<tr id="row_0_4_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1ProactiveThreadpool.html" target="_self">ProactiveThreadpool</a></td><td class="desc">Executor that implements a centralized task queue with a proactive execution strategy </td></tr>
113+
<tr id="row_0_5_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1SimpleThreadpool.html" target="_self">SimpleThreadpool</a></td><td class="desc">Executor that implements a centralized task queue with a simple execution strategy </td></tr>
114+
<tr id="row_0_6_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1SpeculativeThreadpool.html" target="_self">SpeculativeThreadpool</a></td><td class="desc">Executor that implements a centralized task queue with a speculative execution strategy </td></tr>
115+
<tr id="row_0_7_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1SubflowBuilder.html" target="_self">SubflowBuilder</a></td><td class="desc">The building blocks of dynamic tasking </td></tr>
116+
<tr id="row_0_8_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1Task.html" target="_self">Task</a></td><td class="desc">Handle to modify and access a task </td></tr>
117+
<tr id="row_0_9_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1WorkStealingQueue.html" target="_self">WorkStealingQueue</a></td><td class="desc">Lock-free unbounded single-producer multiple-consumer queue </td></tr>
118+
<tr id="row_0_10_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="classtf_1_1WorkStealingThreadpool.html" target="_self">WorkStealingThreadpool</a></td><td class="desc">Executor that implements an efficient work stealing algorithm </td></tr>
111119
</table>
112120
</div><!-- directory -->
113121
</div><!-- contents -->
@@ -117,7 +125,7 @@
117125
<ul>
118126
<li class="footer">Generated by
119127
<a href="http://www.doxygen.org/index.html">
120-
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
128+
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.16 </li>
121129
</ul>
122130
</div>
123131
</body>

docs/annotated_dup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var annotated_dup =
44
[ "BasicTaskflow", "classtf_1_1BasicTaskflow.html", "classtf_1_1BasicTaskflow" ],
55
[ "Error", "structtf_1_1Error.html", "structtf_1_1Error" ],
66
[ "FlowBuilder", "classtf_1_1FlowBuilder.html", "classtf_1_1FlowBuilder" ],
7+
[ "Framework", "classtf_1_1Framework.html", "classtf_1_1Framework" ],
78
[ "ProactiveThreadpool", "classtf_1_1ProactiveThreadpool.html", "classtf_1_1ProactiveThreadpool" ],
89
[ "SimpleThreadpool", "classtf_1_1SimpleThreadpool.html", "classtf_1_1SimpleThreadpool" ],
910
[ "SpeculativeThreadpool", "classtf_1_1SpeculativeThreadpool.html", "classtf_1_1SpeculativeThreadpool" ],

0 commit comments

Comments
 (0)