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.
382 lines
19 KiB
382 lines
19 KiB
<!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.4"/>
|
|
<title>tbb::interface7::task_arena Class Reference</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.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! -->
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.4 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<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 id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="a00222.html">tbb</a></li><li class="navelem"><b>interface7</b></li><li class="navelem"><a class="el" href="a00135.html">task_arena</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pub-static-methods">Static Public Member Functions</a> |
|
|
<a href="#friends">Friends</a> |
|
|
<a href="a00369.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">tbb::interface7::task_arena Class Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p><code>#include <task_arena.h></code></p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for tbb::interface7::task_arena:</div>
|
|
<div class="dyncontent">
|
|
<div class="center">
|
|
<img src="a00135.png" usemap="#tbb::interface7::task_arena_map" alt=""/>
|
|
<map id="tbb::interface7::task_arena_map" name="tbb::interface7::task_arena_map">
|
|
</map>
|
|
</div></div>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a6035737ce1a8db376d06880dae9d0c40"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#a6035737ce1a8db376d06880dae9d0c40">task_arena</a> (int max_concurrency=automatic, unsigned reserved_for_masters=1)</td></tr>
|
|
<tr class="memdesc:a6035737ce1a8db376d06880dae9d0c40"><td class="mdescLeft"> </td><td class="mdescRight">Creates <a class="el" href="a00135.html">task_arena</a> with certain concurrency limits. <a href="#a6035737ce1a8db376d06880dae9d0c40">More...</a><br/></td></tr>
|
|
<tr class="separator:a6035737ce1a8db376d06880dae9d0c40"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a70d122b3e6e4760c6053c5c230c715ef"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a70d122b3e6e4760c6053c5c230c715ef"></a>
|
|
 </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#a70d122b3e6e4760c6053c5c230c715ef">task_arena</a> (const <a class="el" href="a00135.html">task_arena</a> &s)</td></tr>
|
|
<tr class="memdesc:a70d122b3e6e4760c6053c5c230c715ef"><td class="mdescLeft"> </td><td class="mdescRight">Copies settings from another <a class="el" href="a00135.html">task_arena</a>. <br/></td></tr>
|
|
<tr class="separator:a70d122b3e6e4760c6053c5c230c715ef"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a955131a79f8dc5a0a5c9ffa66a7e7140"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a955131a79f8dc5a0a5c9ffa66a7e7140"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#a955131a79f8dc5a0a5c9ffa66a7e7140">initialize</a> ()</td></tr>
|
|
<tr class="memdesc:a955131a79f8dc5a0a5c9ffa66a7e7140"><td class="mdescLeft"> </td><td class="mdescRight">Forces allocation of the resources for the <a class="el" href="a00135.html">task_arena</a> as specified in constructor arguments. <br/></td></tr>
|
|
<tr class="separator:a955131a79f8dc5a0a5c9ffa66a7e7140"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a754d60ba6981461eb7c86afd14d3da2a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a754d60ba6981461eb7c86afd14d3da2a"></a>
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#a754d60ba6981461eb7c86afd14d3da2a">initialize</a> (int max_concurrency, unsigned reserved_for_masters=1)</td></tr>
|
|
<tr class="memdesc:a754d60ba6981461eb7c86afd14d3da2a"><td class="mdescLeft"> </td><td class="mdescRight">Overrides concurrency level and forces initialization of internal representation. <br/></td></tr>
|
|
<tr class="separator:a754d60ba6981461eb7c86afd14d3da2a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aecb3eedeacfe8469a91c17525dae7fc9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#aecb3eedeacfe8469a91c17525dae7fc9">terminate</a> ()</td></tr>
|
|
<tr class="separator:aecb3eedeacfe8469a91c17525dae7fc9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9ff5a35a219953a4f3d99b833fa5f683"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#a9ff5a35a219953a4f3d99b833fa5f683">~task_arena</a> ()</td></tr>
|
|
<tr class="separator:a9ff5a35a219953a4f3d99b833fa5f683"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ad85856cefa30d42155a2b122b03efd8c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#ad85856cefa30d42155a2b122b03efd8c">is_active</a> () const </td></tr>
|
|
<tr class="separator:ad85856cefa30d42155a2b122b03efd8c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8034275ed2fffa68f70484043b90d406"><td class="memTemplParams" colspan="2">template<typename F > </td></tr>
|
|
<tr class="memitem:a8034275ed2fffa68f70484043b90d406"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00135.html#a8034275ed2fffa68f70484043b90d406">enqueue</a> (const F &f)</td></tr>
|
|
<tr class="separator:a8034275ed2fffa68f70484043b90d406"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9a04ab4afb2d74b0317618f59ab49be7"><td class="memTemplParams" colspan="2">template<typename F > </td></tr>
|
|
<tr class="memitem:a9a04ab4afb2d74b0317618f59ab49be7"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00135.html#a9a04ab4afb2d74b0317618f59ab49be7">enqueue</a> (const F &f, priority_t p)</td></tr>
|
|
<tr class="separator:a9a04ab4afb2d74b0317618f59ab49be7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:af0c96f325b59d567b4c720f2830adde8"><td class="memTemplParams" colspan="2">template<typename F > </td></tr>
|
|
<tr class="memitem:af0c96f325b59d567b4c720f2830adde8"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00135.html#af0c96f325b59d567b4c720f2830adde8">execute</a> (F &f)</td></tr>
|
|
<tr class="separator:af0c96f325b59d567b4c720f2830adde8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ab8442c8e9e3e678349409e08cabc7ae2"><td class="memTemplParams" colspan="2">template<typename F > </td></tr>
|
|
<tr class="memitem:ab8442c8e9e3e678349409e08cabc7ae2"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00135.html#ab8442c8e9e3e678349409e08cabc7ae2">execute</a> (const F &f)</td></tr>
|
|
<tr class="separator:ab8442c8e9e3e678349409e08cabc7ae2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a07d87dff8c6116ee349684e10f754aeb"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#a07d87dff8c6116ee349684e10f754aeb">debug_wait_until_empty</a> ()</td></tr>
|
|
<tr class="separator:a07d87dff8c6116ee349684e10f754aeb"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
|
|
Static Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:a4c107b6a4cc79183923fe2433d25644f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4c107b6a4cc79183923fe2433d25644f"></a>
|
|
static int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00135.html#a4c107b6a4cc79183923fe2433d25644f">current_slot</a> ()</td></tr>
|
|
<tr class="memdesc:a4c107b6a4cc79183923fe2433d25644f"><td class="mdescLeft"> </td><td class="mdescRight">Returns the index, aka slot number, of the calling thread in its current arena. <br/></td></tr>
|
|
<tr class="separator:a4c107b6a4cc79183923fe2433d25644f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
|
|
Friends</h2></td></tr>
|
|
<tr class="memitem:a6887d06dd0f104ab6c06fdddca4d2471"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6887d06dd0f104ab6c06fdddca4d2471"></a>
|
|
class </td><td class="memItemRight" valign="bottom"><b>tbb::internal::task_scheduler_observer_v3</b></td></tr>
|
|
<tr class="separator:a6887d06dd0f104ab6c06fdddca4d2471"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>1-to-1 proxy representation class of scheduler's arena Constructors set up settings only, real construction is deferred till the first method invocation Destructor only removes one of the references to the inner arena representation. Final destruction happens when all the references (and the work) are gone. </p>
|
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" id="a6035737ce1a8db376d06880dae9d0c40"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">tbb::interface7::task_arena::task_arena </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"><em>max_concurrency</em> = <code>automatic</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned </td>
|
|
<td class="paramname"><em>reserved_for_masters</em> = <code>1</code> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Creates <a class="el" href="a00135.html">task_arena</a> with certain concurrency limits. </p>
|
|
<p>Sets up settings only, real construction is deferred till the first method invocation </p>
|
|
<ul>
|
|
<li>max_concurrency specifies total number of slots in arena where threads work </li>
|
|
<li>reserved_for_masters specifies number of slots to be used by master threads only. Value of 1 is default and reflects behavior of implicit arenas. </li>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a9ff5a35a219953a4f3d99b833fa5f683"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">tbb::interface7::task_arena::~task_arena </td>
|
|
<td>(</td>
|
|
<td class="paramname">)</td><td></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Removes the reference to the internal arena representation, and destroys the external object. Not thread safe wrt concurrent invocations of other methods. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a class="anchor" id="a07d87dff8c6116ee349684e10f754aeb"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::interface7::task_arena::debug_wait_until_empty </td>
|
|
<td>(</td>
|
|
<td class="paramname">)</td><td></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Wait for all work in the arena to be completed Even submitted by other application threads Joins arena if/when possible (in the same way as <a class="el" href="a00135.html#af0c96f325b59d567b4c720f2830adde8">execute()</a>) </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a8034275ed2fffa68f70484043b90d406"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename F > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::interface7::task_arena::enqueue </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const F & </td>
|
|
<td class="paramname"><em>f</em>)</td><td></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Enqueues a task into the arena to process a functor, and immediately returns. Does not require the calling thread to join the arena </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="a9a04ab4afb2d74b0317618f59ab49be7"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename F > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::interface7::task_arena::enqueue </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const F & </td>
|
|
<td class="paramname"><em>f</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">priority_t </td>
|
|
<td class="paramname"><em>p</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Enqueues a task with priority p into the arena to process a functor f, and immediately returns. Does not require the calling thread to join the arena </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="af0c96f325b59d567b4c720f2830adde8"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename F > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::interface7::task_arena::execute </td>
|
|
<td>(</td>
|
|
<td class="paramtype">F & </td>
|
|
<td class="paramname"><em>f</em>)</td><td></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Joins the arena and executes a functor, then returns If not possible to join, wraps the functor into a task, enqueues it and waits for task completion Can decrement the arena demand for workers, causing a worker to leave and free a slot to the calling thread </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ab8442c8e9e3e678349409e08cabc7ae2"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename F > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::interface7::task_arena::execute </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const F & </td>
|
|
<td class="paramname"><em>f</em>)</td><td></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Joins the arena and executes a functor, then returns If not possible to join, wraps the functor into a task, enqueues it and waits for task completion Can decrement the arena demand for workers, causing a worker to leave and free a slot to the calling thread </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ad85856cefa30d42155a2b122b03efd8c"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool tbb::interface7::task_arena::is_active </td>
|
|
<td>(</td>
|
|
<td class="paramname">)</td><td></td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Returns true if the arena is active (initialized); false otherwise. The name was chosen to match a <a class="el" href="a00141.html" title="Class delimiting the scope of task scheduler activity. ">task_scheduler_init</a> method with the same semantics. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="aecb3eedeacfe8469a91c17525dae7fc9"></a>
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void tbb::interface7::task_arena::terminate </td>
|
|
<td>(</td>
|
|
<td class="paramname">)</td><td></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Removes the reference to the internal arena representation. Not thread safe wrt concurrent invocations of other methods. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li>task_arena.h</li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<hr>
|
|
<p></p>
|
|
Copyright © 2005-2014 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.
|