开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 37

chuck/cpp-taskflow

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (3)
标签 (8)
master
dev
cpp14
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
master
分支 (3)
标签 (8)
master
dev
cpp14
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (3)
标签 (8)
master
dev
cpp14
v2.5.0
2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
cpp-taskflow
/
docs
/
FAQ.html
cpp-taskflow
/
docs
/
FAQ.html
FAQ.html 11.32 KB
一键复制 编辑 原始数据 按行查看 历史
tsung-wei-huang 提交于 2020年06月10日 09:01 +08:00 . added version macro
<!-- 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>Taskflow Handbook</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/taskflow/taskflow">Taskflow</a>
&#160;<span id="projectnumber">2.6.0-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 Taskflow. If you cannot find a solution here, please post an issue at <a href="https://github.com/taskflow/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 Taskflow?</h2>
<p>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 Taskflow in my projects?</h2>
<p>Taskflow is a header-only library with zero dependencies. The only thing you need is a C++14 compiler. To use Taskflow, simply drop the folder <code>taskflow/</code> to your project and include taskflow.hpp.</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 Taskflow handle?</h2>
<p>Benchmarks showed 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 Taskflow have backward compatibility with C++03/98/11?</h2>
<p>Unfortunately, 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 Taskflow schedule tasks?</h2>
<p>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. 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, 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 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 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, B will run 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...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

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

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

取消
提交

简介

cpp-taskflow 是一个开源的 C++ 并行任务编程库,cpp-tastflow 非常快,只包含头文件,可以帮你快速编写包含复杂任务依赖的并行程序
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/chuck_chen/cpp-taskflow.git
git@gitee.com:chuck_chen/cpp-taskflow.git
chuck_chen
cpp-taskflow
cpp-taskflow
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

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