Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (1)
Tags (3)
master
v1.0.2
v1.0.1
v1.0.0
master
Branches (1)
Tags (3)
master
v1.0.2
v1.0.1
v1.0.0
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (1)
Tags (3)
master
v1.0.2
v1.0.1
v1.0.0
cpp-taskflow
/
docs
/
FAQ.html
cpp-taskflow
/
docs
/
FAQ.html
FAQ.html 11.46 KB
Copy Edit Raw Blame History
tsung-wei-huang authored 2020年04月25日 06:35 +08:00 . updated docs
<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Cpp-Taskflow</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname"><a href="https://github.com/cpp-taskflow/cpp-taskflow">Cpp-Taskflow</a>
&#160;<span id="projectnumber">2.4-master-branch</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('FAQ.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Frequently Asked Questions </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This page summarizes a list of frequently asked questions about Cpp-Taskflow. If you cannot find a solution here, please post an issue at <a href="https://github.com/cpp-taskflow/cpp-taskflow/issues">here</a>.</p>
<h1><a class="anchor" id="GeneralQuestions"></a>
General Questions</h1>
<h2><a class="anchor" id="GeneralQuestion1"></a>
Q1: What's the goal of Cpp-Taskflow?</h2>
<p>Cpp-Taskflow aims to help C++ developers quickly implement efficient parallel decomposition strategies using task-based approaches.</p>
<h2><a class="anchor" id="GeneralQuestion2"></a>
Q2: How do I use Cpp-Taskflow in my projects?</h2>
<p>Cpp-Taskflow is a header-only library with zero dependencies. The only thing you need is a C++14 compiler. To use Cpp-Taskflow, simply drop the folder <code>taskflow/</code> to your project and include <a class="el" href="taskflow_8hpp_source.html">taskflow.hpp</a>.</p>
<h2><a class="anchor" id="GeneralQuestion3"></a>
Q3: What is the difference between static tasking and dynamic tasking?</h2>
<p>Static tasking refers to those tasks created before execution, while dynamic tasking refers to those tasks created during the execution of static tasks or dynamic tasks (nested). Dynamic tasks created by the same task node are grouped together to a subflow.</p>
<h2><a class="anchor" id="GeneralQuestion4"></a>
Q4: How many tasks can Cpp-Taskflow handle?</h2>
<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>
<h2><a class="anchor" id="GeneralQuestion5"></a>
Q5: What is the weird hex value, like 0x7fc39d402ab0, in the dumped graph?</h2>
<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>
<h2><a class="anchor" id="GeneralQuestion6"></a>
Q6: Does Cpp-Taskflow have backward compatibility with C++03/98/11?</h2>
<p>Unfortunately, Cpp-Taskflow is heavily relying on modern C++14's features/idoms/STL and it is very difficult to provide a version that compiles under older C++ versions.</p>
<h2><a class="anchor" id="GeneralQuestion7"></a>
Q7: How does Cpp-Taskflow schedule tasks?</h2>
<p>Cpp-Taskflow implemented a very efficient <a href="https://en.wikipedia.org/wiki/Work_stealing">work-stealing scheduler</a> to execute task dependency graphs. The source code is available at <code><a class="el" href="executor_8hpp_source.html">taskflow/core/executor.hpp</a></code>.</p>
<h2><a class="anchor" id="GeneralQuestion8"></a>
Q8: What is the overhead of taskflow?</h2>
<p>Creating a taskflow has certain overhead. For example, creating a task and a dependency takes about 61 and 14 nanoseconds in our system (Intel 4-core CPU at 2.00GHz). The time is amortized over 1M operations, since we have implemented an object pool to recycle tasks for minimal overhead.</p>
<h2><a class="anchor" id="GeneralQuestion9"></a>
Q9: How does it compare to existing task programming systems?</h2>
<p>There is a large amount of work on programming systems (e.g., StarPU, Intel TBB, OpenMP, PaRSEC, Kokkos, HPX) in the interest of simplifying the programming complexity of parallel and heterogeneous computing. Each of these systems has its own pros and cons and deserves a reason to exist. However, they do have some problems, particularly from the standpoint of ease of use, static control flow, and scheduling efficiency. Cpp-Taskflow addresses these limitations through a simple, expressive, and transparent graph programming model.</p>
<h2><a class="anchor" id="GeneralQuestion10"></a>
Q10: Do you try to simplify the GPU kernel programming?</h2>
<p>No, we do not develop new programming models to simplify the kernel programming. The rationale is simple: Writing efficient kernels requires domain-specific knowledge and developers often require direct access to the native GPU programming interface. High-level kernel programming models or abstractions all come with restricted applicability. Despite non-trivial kernel programming, we believe what makes heterogeneous computing difficult are surrounding tasks. A mistake made by task scheduling can outweigh all speed-up benefits from a highly optimized kernel. Therefore, Cpp-Taskflow focuses on heterogeneous tasking that affects the overall system performance to a large extent.</p>
<h2><a class="anchor" id="GeneralQuestion11"></a>
Q11: Do you have any real use cases?</h2>
<p>We have applied Cpp-Taskflow to solve many realistic workloads and demonstrated promising performance scalability and programming productivity. Please refer to <a class="el" href="usecases.html">Real Use Cases</a> and <a class="el" href="References.html">References</a>. </p><hr/>
<h1><a class="anchor" id="ProgrammingQuestions"></a>
Programming Questions</h1>
<h2><a class="anchor" id="ProgrammingQuestions1"></a>
Q1: What is the difference between Cpp-Taskflow threads and workers?</h2>
<p>The master thread owns the thread pool and can spawn workers to run tasks or shutdown the pool. Giving taskflow <code>N</code> threads means using <code>N</code> threads to do the works, and there is a total of <code>N+1</code> threads (including the master thread) in the program. Please refer to <a class="el" href="chapter2.html#C2_CreateAnExecutor">Create an Executor</a> for more details.</p>
<h2><a class="anchor" id="ProgrammingQuestions2"></a>
Q2: What is the Lifetime of a Task and a Graph?</h2>
<p>The lifetime of a task sticks with its parent graph. A task is not destroyed until its parent graph is destroyed. Please refer to <a class="el" href="chapter1.html#C1_LifetimeOfATask">Lifetime of A Task</a> for more details.</p>
<h2><a class="anchor" id="ProgrammingQuestions3"></a>
Q3: Is taskflow thread-safe?</h2>
<p>No, the taskflow object is not thread-safe. Multiple threads cannot create tasks from the same taskflow at the same time.</p>
<h2><a class="anchor" id="ProgrammingQuestions4"></a>
Q4: Is executor thread-safe?</h2>
<p>Yes, the executor object is thread-safe. You can have multiple threads run their taskflows on one executor.</p>
<h2><a class="anchor" id="ProgrammingQuestions5"></a>
Q5: My program hangs and never returns after dispatching a taskflow graph. What's wrong?</h2>
<p>When the program hangs forever it is very likely your taskflow graph has a cycle or not properly conditioned (see <a class="el" href="chapter4.html">C4: Conditional Tasking</a>). Try the <a class="el" href="classtf_1_1Taskflow.html#ac433018262e44b12c4cc9f0c4748d758" title="dumps the taskflow to a std::ostream in DOT format ">tf::Taskflow::dump</a> method to debug the graph before dispatching your taskflow graph.</p>
<h2><a class="anchor" id="ProgrammingQuestions6"></a>
Q6: In the following example where B spawns a joined subflow of two tasks B1 and B2, do they run concurrently with task A?</h2>
<div class="image">
<img src="dynamic_graph.png" alt="dynamic_graph.png" width="60%"/>
</div>
<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>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
</ul>
</div>
</body>
</html>
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

Fast C++ Parallel Programming with Task Dependencies
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/tomgee/cpp-taskflow.git
git@gitee.com:tomgee/cpp-taskflow.git
tomgee
cpp-taskflow
cpp-taskflow
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /