You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
628 lines
46 KiB
628 lines
46 KiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>tbb::task Class Reference</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.4.7 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li id="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
</ul></div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul></div>
|
|
<div class="nav">
|
|
<a class="el" href="a00428.html">tbb</a>::<a class="el" href="a00349.html">task</a></div>
|
|
<h1>tbb::task Class Reference<br>
|
|
<small>
|
|
[<a class="el" href="a00446.html">Task Scheduling</a>]</small>
|
|
</h1><!-- doxytag: class="tbb::task" -->Base class for user-defined tasks.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <task.h></code>
|
|
<p>
|
|
<p>Inheritance diagram for tbb::task:
|
|
<p><center><img src="a00349.png" usemap="#tbb::task_map" border="0" alt=""></center>
|
|
<map name="tbb::task_map">
|
|
<area href="a00292.html" alt="tbb::empty_task" shape="rect" coords="0,56,97,80">
|
|
</map>
|
|
<a href="a00135.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef internal::affinity_id </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#d61bb32389d3857bf7511d69beaafb76">affinity_id</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">An id as used for specifying affinity. <a href="#d61bb32389d3857bf7511d69beaafb76"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293ead0fe2302ccc360923f738c2ed7ec1b9">executing</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">task is running, and will be destroyed after method <a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute()</a> completes. <a href="#4a3c415562d17905390ea5b49d12293ead0fe2302ccc360923f738c2ed7ec1b9"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e3bf499aa6e6487cd1ace883a63100513">reexecute</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">task to be rescheduled. <a href="#4a3c415562d17905390ea5b49d12293e3bf499aa6e6487cd1ace883a63100513"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e0841dcf1c2a96dee9aa7b69f636cb81a">ready</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">task is in ready pool, or is going to be put there, or was just taken off. <a href="#4a3c415562d17905390ea5b49d12293e0841dcf1c2a96dee9aa7b69f636cb81a"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293ebe94d3348dd038e41107819f00c1884c">allocated</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">task object is freshly allocated or recycled. <a href="#4a3c415562d17905390ea5b49d12293ebe94d3348dd038e41107819f00c1884c"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293ecc67ca92bd6f1ce9738a1e9e7206b735">freed</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">task object is on free list, or is going to be put there, or was just taken off. <a href="#4a3c415562d17905390ea5b49d12293ecc67ca92bd6f1ce9738a1e9e7206b735"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e58debec6ab130290640d0cc2eedba35d">recycle</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">task to be recycled as continuation <a href="#4a3c415562d17905390ea5b49d12293e58debec6ab130290640d0cc2eedba35d"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e">state_type</a> { <br>
|
|
<a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293ead0fe2302ccc360923f738c2ed7ec1b9">executing</a>,
|
|
<a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e3bf499aa6e6487cd1ace883a63100513">reexecute</a>,
|
|
<a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e0841dcf1c2a96dee9aa7b69f636cb81a">ready</a>,
|
|
<a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293ebe94d3348dd038e41107819f00c1884c">allocated</a>,
|
|
<br>
|
|
<a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293ecc67ca92bd6f1ce9738a1e9e7206b735">freed</a>,
|
|
<a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e58debec6ab130290640d0cc2eedba35d">recycle</a>
|
|
<br>
|
|
}</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enumeration of task states that the scheduler considers. <a href="a00349.html#4a3c415562d17905390ea5b49d12293e">More...</a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="98245ee0473f84cb19dbbf8c81134908"></a><!-- doxytag: member="tbb::task::~task" ref="98245ee0473f84cb19dbbf8c81134908" args="()" -->
|
|
virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#98245ee0473f84cb19dbbf8c81134908">~task</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="22c298cd40937a431a06777423f002f6"></a><!-- doxytag: member="tbb::task::execute" ref="22c298cd40937a431a06777423f002f6" args="()=0" -->
|
|
virtual <a class="el" href="a00349.html">task</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute</a> ()=0</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Should be overridden by derived classes. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">internal::allocate_continuation_proxy & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#1434c79a5138993269d034008bff7329">allocate_continuation</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns proxy for overloaded new that allocates a continuation task of *this. <a href="#1434c79a5138993269d034008bff7329"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1ff794f7053cd9148d5f280fbf07377f"></a><!-- doxytag: member="tbb::task::allocate_child" ref="1ff794f7053cd9148d5f280fbf07377f" args="()" -->
|
|
internal::allocate_child_proxy & </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#1ff794f7053cd9148d5f280fbf07377f">allocate_child</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns proxy for overloaded new that allocates a child task of *this. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void __TBB_EXPORTED_METHOD </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#dfaacf92685e5f86393bf657b2853bf8">destroy</a> (<a class="el" href="a00349.html">task</a> &t)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy a task. <a href="#dfaacf92685e5f86393bf657b2853bf8"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#a67a79e18f62b43a623a00cfbd76db4c">recycle_as_continuation</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Change this to be a continuation of its former self. <a href="#a67a79e18f62b43a623a00cfbd76db4c"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#3b290d14109704e2b69dc1ac980a7a76">recycle_as_safe_continuation</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Recommended to use, safe variant of recycle_as_continuation. <a href="#3b290d14109704e2b69dc1ac980a7a76"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="db399855177438bbc9cc61d508dae8d2"></a><!-- doxytag: member="tbb::task::recycle_as_child_of" ref="db399855177438bbc9cc61d508dae8d2" args="(task &new_parent)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#db399855177438bbc9cc61d508dae8d2">recycle_as_child_of</a> (<a class="el" href="a00349.html">task</a> &new_parent)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Change this to be a child of new_parent. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#4f1be9bbcdb487830dbe298b68d85144">recycle_to_reexecute</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Schedule this for reexecution after current <a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute()</a> returns. <a href="#4f1be9bbcdb487830dbe298b68d85144"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="7653ceef53a188d05b5c779e1104b698"></a><!-- doxytag: member="tbb::task::depth" ref="7653ceef53a188d05b5c779e1104b698" args="() const " -->
|
|
intptr_t </td><td class="memItemRight" valign="bottom"><b>depth</b> () const </td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e864e9c80e3d79f00d77fb99f4757621"></a><!-- doxytag: member="tbb::task::set_depth" ref="e864e9c80e3d79f00d77fb99f4757621" args="(intptr_t)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><b>set_depth</b> (intptr_t)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c83fcc26f6513f0e06de70cbab9dee46"></a><!-- doxytag: member="tbb::task::add_to_depth" ref="c83fcc26f6513f0e06de70cbab9dee46" args="(int)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><b>add_to_depth</b> (int)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="06a4206a57e8e12a439b14d6d41cfd92"></a><!-- doxytag: member="tbb::task::set_ref_count" ref="06a4206a57e8e12a439b14d6d41cfd92" args="(int count)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#06a4206a57e8e12a439b14d6d41cfd92">set_ref_count</a> (int count)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set reference count. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#f5fb43c7ad0de5a4b95703cebc39e345">increment_ref_count</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Atomically increment reference count and returns its old value. <a href="#f5fb43c7ad0de5a4b95703cebc39e345"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#ef4680f5c148020c5e7e43ddef44cd5d">decrement_ref_count</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Atomically decrement reference count and returns its new value. <a href="#ef4680f5c148020c5e7e43ddef44cd5d"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3ce28ca9baa771cfc37ecd72e69c4f3c"></a><!-- doxytag: member="tbb::task::spawn_and_wait_for_all" ref="3ce28ca9baa771cfc37ecd72e69c4f3c" args="(task &child)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#3ce28ca9baa771cfc37ecd72e69c4f3c">spawn_and_wait_for_all</a> (<a class="el" href="a00349.html">task</a> &child)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Similar to spawn followed by wait_for_all, but more efficient. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="894ab68378e502776d8220eea7ce9fa1"></a><!-- doxytag: member="tbb::task::spawn_and_wait_for_all" ref="894ab68378e502776d8220eea7ce9fa1" args="(task_list &list)" -->
|
|
void __TBB_EXPORTED_METHOD </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#894ab68378e502776d8220eea7ce9fa1">spawn_and_wait_for_all</a> (<a class="el" href="a00354.html">task_list</a> &list)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Similar to spawn followed by wait_for_all, but more efficient. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#53d2615ad9c38859b4c8080936600283">wait_for_all</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wait for reference count to become one, and set reference count to zero. <a href="#53d2615ad9c38859b4c8080936600283"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="314e98ee4347ccec83efcb9ee22e8596"></a><!-- doxytag: member="tbb::task::parent" ref="314e98ee4347ccec83efcb9ee22e8596" args="() const " -->
|
|
<a class="el" href="a00349.html">task</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#314e98ee4347ccec83efcb9ee22e8596">parent</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">task on whose behalf this task is working, or NULL if this is a root. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d2eaf79fcaa3ae473e3bd3f44bd8a464"></a><!-- doxytag: member="tbb::task::set_parent" ref="d2eaf79fcaa3ae473e3bd3f44bd8a464" args="(task *p)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#d2eaf79fcaa3ae473e3bd3f44bd8a464">set_parent</a> (<a class="el" href="a00349.html">task</a> *p)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">sets parent task pointer to specified value <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="a00353.html">task_group_context</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#d8c36a93f3972590fbb65ff1cef3173b">context</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">This method is deprecated and will be removed in the future. <a href="#d8c36a93f3972590fbb65ff1cef3173b"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5987123486afca36ddebb9e2a8b7779a"></a><!-- doxytag: member="tbb::task::group" ref="5987123486afca36ddebb9e2a8b7779a" args="()" -->
|
|
<a class="el" href="a00353.html">task_group_context</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#5987123486afca36ddebb9e2a8b7779a">group</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Pointer to the task group descriptor. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f9169402702f56bf519448aaf34450aa"></a><!-- doxytag: member="tbb::task::is_stolen_task" ref="f9169402702f56bf519448aaf34450aa" args="() const " -->
|
|
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#f9169402702f56bf519448aaf34450aa">is_stolen_task</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">True if task was stolen from the task pool of another thread. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0af7b2d7e6e8b4333b2accfce3dfb374"></a><!-- doxytag: member="tbb::task::state" ref="0af7b2d7e6e8b4333b2accfce3dfb374" args="() const " -->
|
|
<a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e">state_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#0af7b2d7e6e8b4333b2accfce3dfb374">state</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Current execution state. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ad774f55eaec008ae02b236423209ced"></a><!-- doxytag: member="tbb::task::ref_count" ref="ad774f55eaec008ae02b236423209ced" args="() const " -->
|
|
int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#ad774f55eaec008ae02b236423209ced">ref_count</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The internal reference count. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c26718b3b247cd13deb1a741902e7105"></a><!-- doxytag: member="tbb::task::is_owned_by_current_thread" ref="c26718b3b247cd13deb1a741902e7105" args="() const " -->
|
|
bool __TBB_EXPORTED_METHOD </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#c26718b3b247cd13deb1a741902e7105">is_owned_by_current_thread</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Obsolete, and only retained for the sake of backward compatibility. Always returns true. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dca19d7a45487a7d67a0db517e2b57c9"></a><!-- doxytag: member="tbb::task::set_affinity" ref="dca19d7a45487a7d67a0db517e2b57c9" args="(affinity_id id)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#dca19d7a45487a7d67a0db517e2b57c9">set_affinity</a> (<a class="el" href="a00349.html#d61bb32389d3857bf7511d69beaafb76">affinity_id</a> id)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set affinity for this task. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3a920a56b0bcf2801518fb45b2c9d2be"></a><!-- doxytag: member="tbb::task::affinity" ref="3a920a56b0bcf2801518fb45b2c9d2be" args="() const " -->
|
|
<a class="el" href="a00349.html#d61bb32389d3857bf7511d69beaafb76">affinity_id</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#3a920a56b0bcf2801518fb45b2c9d2be">affinity</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Current affinity of this task. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void __TBB_EXPORTED_METHOD </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#713c338c8eeaebdc5a6b10a69c039b06">note_affinity</a> (<a class="el" href="a00349.html#d61bb32389d3857bf7511d69beaafb76">affinity_id</a> id)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Invoked by scheduler to notify task that it ran on unexpected thread. <a href="#713c338c8eeaebdc5a6b10a69c039b06"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void __TBB_EXPORTED_METHOD </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#62247be9a637a814c8e8f4bcfb3a1908">change_group</a> (<a class="el" href="a00353.html">task_group_context</a> &ctx)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Moves this task from its current group into another one. <a href="#62247be9a637a814c8e8f4bcfb3a1908"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#0f3fb4aac549ab642022450a4bd13326">cancel_group_execution</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initiates cancellation of all tasks in this cancellation group and its subordinate groups. <a href="#0f3fb4aac549ab642022450a4bd13326"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="025f18118c057c4c8db87ff2ce8df975"></a><!-- doxytag: member="tbb::task::is_cancelled" ref="025f18118c057c4c8db87ff2ce8df975" args="() const " -->
|
|
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#025f18118c057c4c8db87ff2ce8df975">is_cancelled</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the context has received cancellation request. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="025f18118c057c4c8db87ff2ce8df975"></a><!-- doxytag: member="tbb::task::is_cancelled" ref="025f18118c057c4c8db87ff2ce8df975" args="() const " -->
|
|
bool </td><td class="memItemRight" valign="bottom"><b>is_cancelled</b> () const </td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9ac8d1542d67d9d80121ff986801ac26"></a><!-- doxytag: member="tbb::task::set_group_priority" ref="9ac8d1542d67d9d80121ff986801ac26" args="(priority_t p)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#9ac8d1542d67d9d80121ff986801ac26">set_group_priority</a> (priority_t p)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Changes priority of the task group this task belongs to. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e1d969a1ccab6796e3b8b2c1a5be33d2"></a><!-- doxytag: member="tbb::task::group_priority" ref="e1d969a1ccab6796e3b8b2c1a5be33d2" args="() const " -->
|
|
priority_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#e1d969a1ccab6796e3b8b2c1a5be33d2">group_priority</a> () const </td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieves current priority of the task group this task belongs to. <br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="23acb0da0afd690da797f9f882027d34"></a><!-- doxytag: member="tbb::task::allocate_root" ref="23acb0da0afd690da797f9f882027d34" args="()" -->
|
|
static internal::allocate_root_proxy </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#23acb0da0afd690da797f9f882027d34">allocate_root</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns proxy for overloaded new that allocates a root task. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8ccc518caf31075a3e073996d2d240a4"></a><!-- doxytag: member="tbb::task::allocate_root" ref="8ccc518caf31075a3e073996d2d240a4" args="(task_group_context &ctx)" -->
|
|
static internal::allocate_root_with_context_proxy </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#8ccc518caf31075a3e073996d2d240a4">allocate_root</a> (<a class="el" href="a00353.html">task_group_context</a> &ctx)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns proxy for overloaded new that allocates a root task associated with user supplied context. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ce8ce689c26a4ddf343829bc3c73290a"></a><!-- doxytag: member="tbb::task::spawn_root_and_wait" ref="ce8ce689c26a4ddf343829bc3c73290a" args="(task &root)" -->
|
|
static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#ce8ce689c26a4ddf343829bc3c73290a">spawn_root_and_wait</a> (<a class="el" href="a00349.html">task</a> &root)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Spawn task allocated by allocate_root, wait for it to complete, and deallocate it. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#c33c7edbaec67aa8a56f48986a9dc69f">spawn_root_and_wait</a> (<a class="el" href="a00354.html">task_list</a> &root_list)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Spawn root tasks on list and wait for all of them to finish. <a href="#c33c7edbaec67aa8a56f48986a9dc69f"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#8365d063c0cc9d7bd616bca47256b93c">enqueue</a> (<a class="el" href="a00349.html">task</a> &t)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enqueue task for starvation-resistant execution. <a href="#8365d063c0cc9d7bd616bca47256b93c"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="fe6bf6aaf84e664134fabb6c4f409ea9"></a><!-- doxytag: member="tbb::task::enqueue" ref="fe6bf6aaf84e664134fabb6c4f409ea9" args="(task &t, priority_t p)" -->
|
|
static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#fe6bf6aaf84e664134fabb6c4f409ea9">enqueue</a> (<a class="el" href="a00349.html">task</a> &t, priority_t p)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enqueue task for starvation-resistant execution on the specified priority level. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bd43e8d6249738efafd12d6a4c72c5e3"></a><!-- doxytag: member="tbb::task::self" ref="bd43e8d6249738efafd12d6a4c72c5e3" args="()" -->
|
|
static <a class="el" href="a00349.html">task</a> &__TBB_EXPORTED_FUNC </td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#bd43e8d6249738efafd12d6a4c72c5e3">self</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The innermost task being executed or destroyed by the current thread at the moment. <br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2bce8ec6e44706e70128f5cf91b76e67"></a><!-- doxytag: member="tbb::task::task" ref="2bce8ec6e44706e70128f5cf91b76e67" args="()" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="a00349.html#2bce8ec6e44706e70128f5cf91b76e67">task</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Friends</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="81d0122aee4ddae419a743ee50d7038e"></a><!-- doxytag: member="tbb::task::interface5::internal::task_base" ref="81d0122aee4ddae419a743ee50d7038e" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>interface5::internal::task_base</b></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5eabadbca46f93ce6fb08290e85a0a65"></a><!-- doxytag: member="tbb::task::task_list" ref="5eabadbca46f93ce6fb08290e85a0a65" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>task_list</b></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e296810002652d771f692e20ca87e898"></a><!-- doxytag: member="tbb::task::internal::scheduler" ref="e296810002652d771f692e20ca87e898" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>internal::scheduler</b></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="387b945c106854e1ed525f0668092930"></a><!-- doxytag: member="tbb::task::internal::allocate_root_proxy" ref="387b945c106854e1ed525f0668092930" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>internal::allocate_root_proxy</b></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ecedb9436fb30df30cb3a52c64bb97e5"></a><!-- doxytag: member="tbb::task::internal::allocate_root_with_context_proxy" ref="ecedb9436fb30df30cb3a52c64bb97e5" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>internal::allocate_root_with_context_proxy</b></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9987b3b1174772e5e853bd94b9f15350"></a><!-- doxytag: member="tbb::task::internal::allocate_continuation_proxy" ref="9987b3b1174772e5e853bd94b9f15350" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>internal::allocate_continuation_proxy</b></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1f9e255654086b52fe107e4d8bbc8b7d"></a><!-- doxytag: member="tbb::task::internal::allocate_child_proxy" ref="1f9e255654086b52fe107e4d8bbc8b7d" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>internal::allocate_child_proxy</b></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0e99ce0045ea3c55d239f38ea026b8a7"></a><!-- doxytag: member="tbb::task::internal::allocate_additional_child_of_proxy" ref="0e99ce0045ea3c55d239f38ea026b8a7" args="" -->
|
|
class </td><td class="memItemRight" valign="bottom"><b>internal::allocate_additional_child_of_proxy</b></td></tr>
|
|
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
Base class for user-defined tasks.
|
|
<p>
|
|
<hr><h2>Member Typedef Documentation</h2>
|
|
<a class="anchor" name="d61bb32389d3857bf7511d69beaafb76"></a><!-- doxytag: member="tbb::task::affinity_id" ref="d61bb32389d3857bf7511d69beaafb76" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef internal::affinity_id <a class="el" href="a00349.html#d61bb32389d3857bf7511d69beaafb76">tbb::task::affinity_id</a> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
An id as used for specifying affinity.
|
|
<p>
|
|
Guaranteed to be integral type. Value of 0 means no affinity.
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Enumeration Documentation</h2>
|
|
<a class="anchor" name="4a3c415562d17905390ea5b49d12293e"></a><!-- doxytag: member="tbb::task::state_type" ref="4a3c415562d17905390ea5b49d12293e" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">enum <a class="el" href="a00349.html#4a3c415562d17905390ea5b49d12293e">tbb::task::state_type</a> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Enumeration of task states that the scheduler considers.
|
|
<p>
|
|
<dl compact><dt><b>Enumerator: </b></dt><dd>
|
|
<table border="0" cellspacing="2" cellpadding="0">
|
|
<tr><td valign="top"><em><a class="anchor" name="4a3c415562d17905390ea5b49d12293ead0fe2302ccc360923f738c2ed7ec1b9"></a><!-- doxytag: member="executing" ref="4a3c415562d17905390ea5b49d12293ead0fe2302ccc360923f738c2ed7ec1b9" args="" -->executing</em> </td><td>
|
|
task is running, and will be destroyed after method <a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute()</a> completes. </td></tr>
|
|
<tr><td valign="top"><em><a class="anchor" name="4a3c415562d17905390ea5b49d12293e3bf499aa6e6487cd1ace883a63100513"></a><!-- doxytag: member="reexecute" ref="4a3c415562d17905390ea5b49d12293e3bf499aa6e6487cd1ace883a63100513" args="" -->reexecute</em> </td><td>
|
|
task to be rescheduled. </td></tr>
|
|
<tr><td valign="top"><em><a class="anchor" name="4a3c415562d17905390ea5b49d12293e0841dcf1c2a96dee9aa7b69f636cb81a"></a><!-- doxytag: member="ready" ref="4a3c415562d17905390ea5b49d12293e0841dcf1c2a96dee9aa7b69f636cb81a" args="" -->ready</em> </td><td>
|
|
task is in ready pool, or is going to be put there, or was just taken off. </td></tr>
|
|
<tr><td valign="top"><em><a class="anchor" name="4a3c415562d17905390ea5b49d12293ebe94d3348dd038e41107819f00c1884c"></a><!-- doxytag: member="allocated" ref="4a3c415562d17905390ea5b49d12293ebe94d3348dd038e41107819f00c1884c" args="" -->allocated</em> </td><td>
|
|
task object is freshly allocated or recycled. </td></tr>
|
|
<tr><td valign="top"><em><a class="anchor" name="4a3c415562d17905390ea5b49d12293ecc67ca92bd6f1ce9738a1e9e7206b735"></a><!-- doxytag: member="freed" ref="4a3c415562d17905390ea5b49d12293ecc67ca92bd6f1ce9738a1e9e7206b735" args="" -->freed</em> </td><td>
|
|
task object is on free list, or is going to be put there, or was just taken off. </td></tr>
|
|
<tr><td valign="top"><em><a class="anchor" name="4a3c415562d17905390ea5b49d12293e58debec6ab130290640d0cc2eedba35d"></a><!-- doxytag: member="recycle" ref="4a3c415562d17905390ea5b49d12293e58debec6ab130290640d0cc2eedba35d" args="" -->recycle</em> </td><td>
|
|
task to be recycled as continuation </td></tr>
|
|
</table>
|
|
</dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="1434c79a5138993269d034008bff7329"></a><!-- doxytag: member="tbb::task::allocate_continuation" ref="1434c79a5138993269d034008bff7329" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">internal::allocate_continuation_proxy& tbb::task::allocate_continuation </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Returns proxy for overloaded new that allocates a continuation task of *this.
|
|
<p>
|
|
The continuation's parent becomes the parent of *this.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="0f3fb4aac549ab642022450a4bd13326"></a><!-- doxytag: member="tbb::task::cancel_group_execution" ref="0f3fb4aac549ab642022450a4bd13326" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool tbb::task::cancel_group_execution </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Initiates cancellation of all tasks in this cancellation group and its subordinate groups.
|
|
<p>
|
|
<dl compact><dt><b>Returns:</b></dt><dd>false if cancellation has already been requested, true otherwise. </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="62247be9a637a814c8e8f4bcfb3a1908"></a><!-- doxytag: member="tbb::task::change_group" ref="62247be9a637a814c8e8f4bcfb3a1908" args="(task_group_context &ctx)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void __TBB_EXPORTED_METHOD tbb::task::change_group </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="a00353.html">task_group_context</a> & </td>
|
|
<td class="paramname"> <em>ctx</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Moves this task from its current group into another one.
|
|
<p>
|
|
Argument ctx specifies the new group.<p>
|
|
The primary purpose of this method is to associate unique task group context with a task allocated for subsequent enqueuing. In contrast to spawned tasks enqueued ones normally outlive the scope where they were created. This makes traditional usage model where task group context are allocated locally on the stack inapplicable. Dynamic allocation of context objects is performance inefficient. Method <a class="el" href="a00349.html#62247be9a637a814c8e8f4bcfb3a1908">change_group()</a> allows to make task group context object a member of the task class, and then associate it with its containing task object in the latter's constructor.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="d8c36a93f3972590fbb65ff1cef3173b"></a><!-- doxytag: member="tbb::task::context" ref="d8c36a93f3972590fbb65ff1cef3173b" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="a00353.html">task_group_context</a>* tbb::task::context </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
This method is deprecated and will be removed in the future.
|
|
<p>
|
|
Use method <a class="el" href="a00349.html#5987123486afca36ddebb9e2a8b7779a">group()</a> instead.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="ef4680f5c148020c5e7e43ddef44cd5d"></a><!-- doxytag: member="tbb::task::decrement_ref_count" ref="ef4680f5c148020c5e7e43ddef44cd5d" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int tbb::task::decrement_ref_count </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Atomically decrement reference count and returns its new value.
|
|
<p>
|
|
Has release semantics.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="dfaacf92685e5f86393bf657b2853bf8"></a><!-- doxytag: member="tbb::task::destroy" ref="dfaacf92685e5f86393bf657b2853bf8" args="(task &t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void __TBB_EXPORTED_METHOD tbb::task::destroy </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="a00349.html">task</a> & </td>
|
|
<td class="paramname"> <em>t</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Destroy a task.
|
|
<p>
|
|
Usually, calling this method is unnecessary, because a task is implicitly deleted after its <a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute()</a> method runs. However, sometimes a task needs to be explicitly deallocated, such as when a root task is used as the parent in spawn_and_wait_for_all.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="8365d063c0cc9d7bd616bca47256b93c"></a><!-- doxytag: member="tbb::task::enqueue" ref="8365d063c0cc9d7bd616bca47256b93c" args="(task &t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void tbb::task::enqueue </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="a00349.html">task</a> & </td>
|
|
<td class="paramname"> <em>t</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline, static]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Enqueue task for starvation-resistant execution.
|
|
<p>
|
|
The task will be enqueued on the normal priority level disregarding the priority of its task group.<p>
|
|
The rationale of such semantics is that priority of an enqueued task is statically fixed at the moment of its enqueuing, while task group priority is dynamic. Thus automatic priority inheritance would be generally a subject to the race, which may result in unexpected behavior.<p>
|
|
Use <a class="el" href="a00349.html#8365d063c0cc9d7bd616bca47256b93c">enqueue()</a> overload with explicit priority value and <a class="el" href="a00349.html#e1d969a1ccab6796e3b8b2c1a5be33d2">task::group_priority()</a> method to implement such priority inheritance when it is really necessary.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="f5fb43c7ad0de5a4b95703cebc39e345"></a><!-- doxytag: member="tbb::task::increment_ref_count" ref="f5fb43c7ad0de5a4b95703cebc39e345" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::task::increment_ref_count </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Atomically increment reference count and returns its old value.
|
|
<p>
|
|
Has acquire semantics
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="713c338c8eeaebdc5a6b10a69c039b06"></a><!-- doxytag: member="tbb::task::note_affinity" ref="713c338c8eeaebdc5a6b10a69c039b06" args="(affinity_id id)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">virtual void __TBB_EXPORTED_METHOD tbb::task::note_affinity </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="a00349.html#d61bb32389d3857bf7511d69beaafb76">affinity_id</a> </td>
|
|
<td class="paramname"> <em>id</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Invoked by scheduler to notify task that it ran on unexpected thread.
|
|
<p>
|
|
Invoked before method <a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute()</a> runs, if task is stolen, or task has affinity but will be executed on another thread.<p>
|
|
The default action does nothing.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="a67a79e18f62b43a623a00cfbd76db4c"></a><!-- doxytag: member="tbb::task::recycle_as_continuation" ref="a67a79e18f62b43a623a00cfbd76db4c" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::task::recycle_as_continuation </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Change this to be a continuation of its former self.
|
|
<p>
|
|
The caller must guarantee that the task's refcount does not become zero until after the method <a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute()</a> returns. Typically, this is done by having method <a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute()</a> return a pointer to a child of the task. If the guarantee cannot be made, use method recycle_as_safe_continuation instead.<p>
|
|
Because of the hazard, this method may be deprecated in the future.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="3b290d14109704e2b69dc1ac980a7a76"></a><!-- doxytag: member="tbb::task::recycle_as_safe_continuation" ref="3b290d14109704e2b69dc1ac980a7a76" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::task::recycle_as_safe_continuation </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Recommended to use, safe variant of recycle_as_continuation.
|
|
<p>
|
|
For safety, it requires additional increment of ref_count. With no descendants and ref_count of 1, it has the semantics of recycle_to_reexecute.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="4f1be9bbcdb487830dbe298b68d85144"></a><!-- doxytag: member="tbb::task::recycle_to_reexecute" ref="4f1be9bbcdb487830dbe298b68d85144" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::task::recycle_to_reexecute </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Schedule this for reexecution after current <a class="el" href="a00349.html#22c298cd40937a431a06777423f002f6">execute()</a> returns.
|
|
<p>
|
|
Made obsolete by recycle_as_safe_continuation; may become deprecated.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="c33c7edbaec67aa8a56f48986a9dc69f"></a><!-- doxytag: member="tbb::task::spawn_root_and_wait" ref="c33c7edbaec67aa8a56f48986a9dc69f" args="(task_list &root_list)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::task::spawn_root_and_wait </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="a00354.html">task_list</a> & </td>
|
|
<td class="paramname"> <em>root_list</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline, static]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Spawn root tasks on list and wait for all of them to finish.
|
|
<p>
|
|
If there are more tasks than worker threads, the tasks are spawned in order of front to back.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="53d2615ad9c38859b4c8080936600283"></a><!-- doxytag: member="tbb::task::wait_for_all" ref="53d2615ad9c38859b4c8080936600283" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::task::wait_for_all </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Wait for reference count to become one, and set reference count to zero.
|
|
<p>
|
|
Works on tasks while waiting.
|
|
</div>
|
|
</div><p>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li>task.h</ul>
|
|
<hr>
|
|
<p></p>
|
|
Copyright © 2005-2013 Intel Corporation. All Rights Reserved.
|
|
<p></p>
|
|
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
|
|
registered trademarks or trademarks of Intel Corporation or its
|
|
subsidiaries in the United States and other countries.
|
|
<p></p>
|
|
* Other names and brands may be claimed as the property of others.
|