|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53757 - in sandbox/task/libs/task/doc: . html html/boost_task
From: oliver.kowalke_at_[hidden]
Date: 2009-06-08 15:38:20
Author: olli
Date: 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
New Revision: 53757
URL: http://svn.boost.org/trac/boost/changeset/53757
Log:
* documentation enhanced
Added:
sandbox/task/libs/task/doc/async.qbk (contents, props changed)
sandbox/task/libs/task/doc/execution_policy.qbk (contents, props changed)
sandbox/task/libs/task/doc/html/boost_task/async.html (contents, props changed)
Text files modified:
sandbox/task/libs/task/doc/acknowledgements.qbk | 2
sandbox/task/libs/task/doc/as_sub_task.qbk | 22
sandbox/task/libs/task/doc/boost_task.qbk | 9
sandbox/task/libs/task/doc/boost_task.xml | 4089 ++++++++++++++++++++++-----------------
sandbox/task/libs/task/doc/default_pool.qbk | 8
sandbox/task/libs/task/doc/fork_join.qbk | 20
sandbox/task/libs/task/doc/handle.qbk | 113
sandbox/task/libs/task/doc/html/boost_task/appendices.html | 19
sandbox/task/libs/task/doc/html/boost_task/as_sub_task.html | 25
sandbox/task/libs/task/doc/html/boost_task/handle.html | 160 +
sandbox/task/libs/task/doc/html/boost_task/motivation.html | 62
sandbox/task/libs/task/doc/html/boost_task/new_thread.html | 42
sandbox/task/libs/task/doc/html/boost_task/own_thread.html | 10
sandbox/task/libs/task/doc/html/boost_task/pool.html | 126
sandbox/task/libs/task/doc/html/boost_task/reference.html | 1741 ++++++++--------
sandbox/task/libs/task/doc/html/boost_task/task.html | 52
sandbox/task/libs/task/doc/html/boost_task/utilities.html | 14
sandbox/task/libs/task/doc/html/index.html | 165 +
sandbox/task/libs/task/doc/introduction.qbk | 42
sandbox/task/libs/task/doc/new_thread.qbk | 24
sandbox/task/libs/task/doc/overview.qbk | 92
sandbox/task/libs/task/doc/own_thread.qbk | 4
sandbox/task/libs/task/doc/pool.qbk | 9
sandbox/task/libs/task/doc/ref_async.qbk | 20
sandbox/task/libs/task/doc/ref_exceptions.qbk | 15
sandbox/task/libs/task/doc/ref_handle.qbk | 118
sandbox/task/libs/task/doc/ref_new_thread.qbk | 3
sandbox/task/libs/task/doc/ref_own_thread.qbk | 3
sandbox/task/libs/task/doc/ref_poolsize.qbk | 7
sandbox/task/libs/task/doc/ref_scanns.qbk | 7
sandbox/task/libs/task/doc/ref_stacksize.qbk | 7
sandbox/task/libs/task/doc/ref_static_pool.qbk | 60
sandbox/task/libs/task/doc/ref_task.qbk | 41
sandbox/task/libs/task/doc/ref_utility.qbk | 4
sandbox/task/libs/task/doc/ref_watermark.qbk | 14
sandbox/task/libs/task/doc/scheduler.qbk | 15
sandbox/task/libs/task/doc/shutdown.qbk | 20
sandbox/task/libs/task/doc/task.qbk | 26
sandbox/task/libs/task/doc/todo.qbk | 2
39 files changed, 3976 insertions(+), 3236 deletions(-)
Modified: sandbox/task/libs/task/doc/acknowledgements.qbk
==============================================================================
--- sandbox/task/libs/task/doc/acknowledgements.qbk (original)
+++ sandbox/task/libs/task/doc/acknowledgements.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -8,7 +8,7 @@
[section:acknowledgements Appendix B: Acknowledgments]
-I'd like to thank Vicente J. Botet Escriba for his comments on the implementation and Anthony Williams and Braddock Gaskill for their future libraries.
+I'd like to thank Vicente J. Botet Escriba for his contributions (default_pool, reschedule_until, sleep, yield) and Anthony Williams and Braddock Gaskill for their future libraries.
[endsect]
Modified: sandbox/task/libs/task/doc/as_sub_task.qbk
==============================================================================
--- sandbox/task/libs/task/doc/as_sub_task.qbk (original)
+++ sandbox/task/libs/task/doc/as_sub_task.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -9,32 +9,16 @@
[section:as_sub_task Execute as sub-task]
__as_sub_task__ is a convenient way to execute a __sub_task__. If the parent task is executed inside a __thread_pool__ the __sub_task__ is put into the local-queue of the
-__worker_thread__ in the other case the __sub_task__ will be executed in a new thread.
+__worker_thread__ in the other case the __sub_task__ will be executed in a new thread. __as_sub_task__ is used as default __ep__ for __fn_async__,
``
boost::task::handle< long > h(
boost::task::async(
- boost::task::as_sub_task(),
boost::task::make_task(
fibonacci,
- 10) ) );
-``
-
-is equivalent to:
-
-
-``
- if ( boost::this_task::runs_in_pool() )
- {
- // put the sub-task into worker-threads local-queue
- }
- else
- {
- boost::task::async(
- boost::task::new_thread(),
- boost::task::make_task(...) );
- }
+ 10),
+ boost::task::as_sub_task() ) );
``
Added: sandbox/task/libs/task/doc/async.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/async.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -0,0 +1,44 @@
+[/
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+
+[section:async Asynchronous execution]
+
+The function __fn_async__ passes the __task__ to the __ep__ which executes the __task__ (for this purpose __ep__ is
+required to provide `handle< R > operator()( task< R > tsk)`).
+__fn_async__ accepts two arguments - the first is an __task__ object and the second an __ep__. For the second argument
+__as_sub_task__ is used per default. The function returns a __handle__ which controls the submitted __task__.
+
+
+``
+ long fibonacci( long n)
+ {
+ if ( n == 0) return 0;
+ if ( n == 1) return 1;
+ long k1( 1), k2( 0);
+ for ( int i( 2); i <= n; ++i)
+ {
+ long tmp( k1);
+ k1 = k1 + k2;
+ k2 = tmp;
+ }
+ return k1;
+ }
+
+ void main()
+ {
+ boost::task::handle< long > h( // get handle associated with the task
+ boost::task::async(
+ boost::task::make_task( // compute fibonacci(10) asynchron
+ fibonacci,
+ 10) ) );
+ std::cout << "id == " << h.get_id() << "\n";
+ std::cout << "fibonacci(10) == " << h.get() << std::endl; // throws boost::task::task_interrupted
+ }
+``
+
+[endsect]
Modified: sandbox/task/libs/task/doc/boost_task.qbk
==============================================================================
--- sandbox/task/libs/task/doc/boost_task.qbk (original)
+++ sandbox/task/libs/task/doc/boost_task.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -24,6 +24,7 @@
[def __boost_thread__ [@http://www.boost.org/libs/thread [*Boost.Thread]]]
[def __boost_future__ [@http://www.justsoftwaresolutions.co.uk/threading/updated-implementation-of-c++-futures-3.html [*Boost.Future]]]
+[template link_async[link_text] [link boost_task.async [link_text]]]
[template link_channel[link_text] [link boost_task.pool.channel [link_text]]]
[template link_forkjoin[link_text] [link boost_task.pool.forkjoin [link_text]]]
[template link_handle[link_text] [link boost_task.handle [link_text]]]
@@ -59,6 +60,9 @@
[def __task_interrupted__ `boost::task::task_interrupted`]
[def __unbounded_channel__ `boost::task::unbounded_channel`]
+[def __waitfor_all__ `boost::task::waitfor_all()`]
+[def __waitfor_any__ `boost::task::waitfor_any()`]
+
[def __full_default_pool__ `boost::task::static_pool< boost::task::unbounded_channel< boost::task::fifo > >`]
[def __fn_delay__ `boost::this_task::delay()`]
@@ -100,8 +104,8 @@
[def __fn_wait_until__ `wait_until()`]
[def __act__ ['asynchronous-completion-token]]
-[def __ae__ ['asynchronous-executor]]
-[def __aes__ ['asynchronous-executors]]
+[def __ep__ ['execution-policy]]
+[def __eps__ ['execution-policies]]
[def __blocked__ ['blocked]]
[def __callable__ ['callable]]
[def __channel__ ['channel]]
@@ -127,6 +131,7 @@
[include introduction.qbk]
[include task.qbk]
[include handle.qbk]
+[include async.qbk]
[include own_thread.qbk]
[include new_thread.qbk]
[include pool.qbk]
Modified: sandbox/task/libs/task/doc/boost_task.xml
==============================================================================
--- sandbox/task/libs/task/doc/boost_task.xml (original)
+++ sandbox/task/libs/task/doc/boost_task.xml 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
-<library id="boost_task" name="Boost.Task" dirname="boost_task" last-revision="$Date: 2009/06/01 12:11:53 $"
+<library id="boost_task" name="Boost.Task" dirname="boost_task" last-revision="$Date: 2009/06/08 19:40:03 $"
xmlns:xi="http://www.w3.org/2001/XInclude">
<libraryinfo>
<authorgroup>
@@ -84,16 +84,29 @@
</listitem>
</itemizedlist>
</listitem>
+ <listitem>
+ <code><phrase role="identifier">get_future</phrase><phrase role="special">()</phrase></code>
+ returns reference to internal future
+ </listitem>
+ <listitem>
+ functions <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">waitfor_all</phrase><phrase role="special">()</phrase></code>/<code><phrase
+ role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">waitfor_any</phrase><phrase role="special">()</phrase></code>
+ to wait for all or any handles
+ </listitem>
</itemizedlist>
</listitem>
<listitem>
<code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
role="identifier">task</phrase><phrase role="special">::</phrase><phrase
role="identifier">async</phrase><phrase role="special">()</phrase></code>,
- executes a task on behalf of <emphasis>asynchronous-executors</emphasis>
+ executes a task on behalf of <emphasis>execution-policies</emphasis> asynchronously
</listitem>
<listitem>
- <emphasis>asynchronous-executor</emphasis> models:
+ <emphasis>execution-policy</emphasis> models:
<itemizedlist>
<listitem>
<code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
@@ -122,14 +135,104 @@
</listitem>
<listitem>
custom pool: task gets executed by a <emphasis>worker-thread</emphasis>
- of a custom <emphasis>thread-pool</emphasis>
+ of a custom <emphasis>thread-pool</emphasis> (for instance with priority
+ scheduling)
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <emphasis>thread-pools</emphasis> with work-stealing algorithm
+ </listitem>
+ <listitem>
+ support of forking and joining sub-tasks
+ <itemizedlist>
+ <listitem>
+ better performance
+ </listitem>
+ <listitem>
+ no deadlock because of inline-execution of sub-tasks
+ </listitem>
+ <listitem>
+ automatically detects if code runs in a <emphasis>thread-pool</emphasis>
+ so the appropriate mechanism for executing the sub-tasks is choosen
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para>
- References
+ In order to use the classes and functions described here, you can either include
+ the specific headers specified by the descriptions of each class or function,
+ or include the master library header:
+ </para>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
+</programlisting>
+ </para>
+ <para>
+ which includes all the other headers in turn.
+ </para>
+ <para>
+ Used namespaces are:
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">namespace</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase>
+<phrase role="keyword">namespace</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_task</phrase>
+</programlisting>
+ </para>
+ <anchor id="boost_task.overview.example"/>
+ <bridgehead renderas="sect3">
+ <link linkend="boost_task.overview.example">Example</link>
+ </bridgehead>
+ <para>
+
+<programlisting><phrase role="keyword">long</phrase> <phrase role="identifier">fibonacci</phrase><phrase role="special">(</phrase> <phrase role="keyword">long</phrase> <phrase role="identifier">n</phrase><phrase role="special">)</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">==</phrase> <phrase role="number">0</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase>
+ <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">==</phrase> <phrase role="number">1</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="number">1</phrase><phrase role="special">;</phrase>
+ <phrase role="keyword">long</phrase> <phrase role="identifier">k1</phrase><phrase role="special">(</phrase> <phrase role="number">1</phrase><phrase role="special">),</phrase> <phrase role="identifier">k2</phrase><phrase role="special">(</phrase> <phrase role="number">0</phrase><phrase role="special">);</phrase>
+ <phrase role="keyword">for</phrase> <phrase role="special">(</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">i</phrase><phrase role="special">(</phrase> <phrase role="number">2</phrase><phrase role="special">);</phrase> <phrase role="identifier">i</phrase> <phrase role="special"><=</phrase> <phrase role="identifier">n</phrase><phrase role="special">;</phrase> <phrase role="special">++</phrase><phrase role="identifier">i</phrase><phrase role="special">)</phrase>
+ <phrase role="special">{</phrase>
+ <phrase role="keyword">long</phrase> <phrase role="identifier">tmp</phrase><phrase role="special">(</phrase> <phrase role="identifier">k1</phrase><phrase role="special">);</phrase>
+ <phrase role="identifier">k1</phrase> <phrase role="special">=</phrase> <phrase role="identifier">k1</phrase> <phrase role="special">+</phrase> <phrase role="identifier">k2</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">k2</phrase> <phrase role="special">=</phrase> <phrase role="identifier">tmp</phrase><phrase role="special">;</phrase>
+ <phrase role="special">}</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="identifier">k1</phrase><phrase role="special">;</phrase>
+<phrase role="special">}</phrase>
+
+<phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h1</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">fibonacci</phrase><phrase role="special">,</phrase>
+ <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h2</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">fibonacci</phrase><phrase role="special">,</phrase>
+ <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h1: id == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h2: id == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h1: is ready == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h2: is ready == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">h1</phrase><phrase role="special">,</phrase> <phrase role="identifier">h2</phrase><phrase role="special">);</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h1: is ready == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h2: is ready == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h1: has value == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h2: has value == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h1: has exception == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"h2: has exception == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(10) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(5) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+<phrase role="special">}</phrase>
+</programlisting>
</para>
+ <anchor id="boost_task.overview.references"/>
+ <bridgehead renderas="sect3">
+ <link linkend="boost_task.overview.references">References</link>
+ </bridgehead>
<itemizedlist>
<listitem>
N2185: Proposed Text for Parallel Task Execution <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2185.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2185.html>
@@ -145,6 +248,10 @@
written by Hans-J. Boehm.
</listitem>
<listitem>
+ N2880: C++ object lifetime interactions with the threads API <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html>
+ written by Hans-J. Boehm and Lawrence Crowl.
+ </listitem>
+ <listitem>
<ulink url="http://herbsutter.wordpress.com">'Sutterâs Mill'</ulink> by
Herb Sutter
</listitem>
@@ -160,17 +267,6 @@
role="bold">Boost.Thread</emphasis></ulink>).
</para>
</note>
- <para>
- In order to use the classes and functions described here, you can either include
- the specific headers specified by the descriptions of each class or function,
- or include the master library header:
- </para>
-
-<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
-</programlisting>
- <para>
- which includes all the other headers in turn.
- </para>
<anchor id="boost_task.overview.tested_platforms"/>
<bridgehead renderas="sect3">
<link linkend="boost_task.overview.tested_platforms">Tested Platforms</link>
@@ -190,9 +286,6 @@
FreeBSD 7.2 (x86), GCC 4.2.1
</listitem>
<listitem>
- OpenSolaris 0811 (x86_64), SunCC 5.10
- </listitem>
- <listitem>
Windows XP Professional (x86), MSVC 9.0
</listitem>
</itemizedlist>
@@ -203,7 +296,8 @@
<itemizedlist>
<listitem>
download the sources form <ulink url="http://www.boostpro.com/vault/index.php">boost-vault</ulink>
- (section <emphasis>Concurrent Programing</emphasis>) or <ulink url="https://svn.boost.org/svn/boost/sandbox/task/">boost-sandbox</ulink>
+ (section <emphasis>Concurrent Programing</emphasis>) or the latest development
+ version from <ulink url="https://svn.boost.org/svn/boost/sandbox/task/">boost-sandbox</ulink>
</listitem>
<listitem>
extract the archive into the boost-source directory
@@ -224,7 +318,7 @@
To speed-up computer-bound work and/or increase the computation-throughput
is a common motivation for parallelizing a program. Especially for interactive
applications that have to process user input while performing some background
- tasks responsivness iss very important. Parallelizing a program requires partitioning
+ tasks responsivness is very important. Parallelizing a program requires partitioning
the program into smaller chunks that can run in parallel. The code can scale
as the hardware gets better without changing the code.
</para>
@@ -246,7 +340,7 @@
<para>
<emphasis role="bold">Boost.Task</emphasis> provides a framework to utilize
the available hardware and provide a way for efficient asynchronous processing
- of time consuming operations. The framework provides some <emphasis>asynchronous-executors</emphasis>,
+ of time consuming operations. The framework provides some <emphasis>execution-policies</emphasis>,
like <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase></code>,
in order to execute the task asynchronously in another execution context (<emphasis
@@ -260,11 +354,11 @@
<phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="comment">// dispatchs task
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase> <phrase role="comment">// asynchronous executor
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
</phrase> <phrase role="identifier">print</phrase><phrase role="special">,</phrase>
- <phrase role="string">"Hello World!"</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-<phrase role="special">}</phrase>
+ <phrase role="string">"Hello World!"</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase><phrase role="special">}</phrase>
</programlisting>
</para>
<para>
@@ -285,11 +379,11 @@
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// get handle associated with the task
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
</phrase> <phrase role="identifier">echo</phrase><phrase role="special">,</phrase>
- <phrase role="string">"Hello World!"</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// wait until task is finished and return the result
+ <phrase role="string">"Hello World!"</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// wait until task is finished and return the result
</phrase><phrase role="special">}</phrase>
</programlisting>
</para>
@@ -307,12 +401,12 @@
<phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// get handle associated with the task
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// long runing task, to be executed asynchronously
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// long runing task, to be executed asynchronously
</phrase> <phrase role="identifier">long_running</phrase><phrase role="special">,</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">millisec</phrase><phrase role="special">(</phrase> <phrase role="number">500</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
- <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">interrupt</phrase><phrase role="special">();</phrase> <phrase role="comment">// interrupt execution of task
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">millisec</phrase><phrase role="special">(</phrase> <phrase role="number">500</phrase><phrase role="special">)</phrase> <phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">interrupt</phrase><phrase role="special">();</phrase> <phrase role="comment">// interrupt execution of task
</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// wait until task is finished, will throw an exeception
</phrase><phrase role="special">}</phrase>
</programlisting>
@@ -344,18 +438,20 @@
<phrase role="special">{</phrase>
<phrase role="comment">// fork a sub-task calculating fibonacci(n-1)
</phrase> <phrase role="identifier">h1</phrase> <phrase role="special">=</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_task</phrase><phrase role="special">::</phrase><phrase role="identifier">get_pool</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
<phrase role="identifier">n</phrase> <phrase role="special">-</phrase> <phrase role="number">1</phrase><phrase role="special">,</phrase>
- <phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">cutof</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_task</phrase><phrase role="special">::</phrase><phrase role="identifier">get_pool</phrase><phrase role="special">()</phrase> <phrase role="special">);</phrase>
+
<phrase role="comment">// fork a sub-task calculating fibonacci(n-2)
</phrase> <phrase role="identifier">h2</phrase> <phrase role="special">=</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_task</phrase><phrase role="special">::</phrase><phrase role="identifier">get_pool</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
<phrase role="identifier">n</phrase> <phrase role="special">-</phrase> <phrase role="number">2</phrase><phrase role="special">,</phrase>
- <phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">cutof</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_task</phrase><phrase role="special">::</phrase><phrase role="identifier">get_pool</phrase><phrase role="special">()</phrase> <phrase role="special">);</phrase>
+
<phrase role="comment">// join the results of both sub-tasks
</phrase> <phrase role="keyword">return</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">+</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">();</phrase>
<phrase role="special">}</phrase>
@@ -363,14 +459,14 @@
<phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// handle for fibonacci calculation
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// handle for fibonacci calculation
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">(),</phrase> <phrase role="comment">// access the default thread-pool
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// calculate fibonacci number 10
-</phrase> <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase> <phrase role="comment">// for numbers < 5 do inline recursive calculation
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// calculate fibonacci number 10
+</phrase> <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase> <phrase role="comment">// for numbers < 5 do inline recursive calculation
</phrase> <phrase role="number">10</phrase><phrase role="special">,</phrase>
- <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+ <phrase role="number">5</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// access the default thread-pool
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
@@ -390,12 +486,12 @@
<para>
<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">(),</phrase> <phrase role="comment">// sub-task executed in a new thread or inside
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// the thread-pool depending upon the parent
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// the thread-pool depending upon the parent
</phrase> <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase> <phrase role="comment">// task is executed inside a thread-pool or not
</phrase> <phrase role="number">10</phrase><phrase role="special">,</phrase>
- <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-</programlisting>
+ <phrase role="number">5</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// sub-task executed in a new thread or inside
+</phrase></programlisting>
</para>
</section>
<section id="boost_task.task">
@@ -408,7 +504,7 @@
role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase></code>
represents a <emphasis>callable</emphasis> (provides <code><phrase role="keyword">operator</phrase><phrase
role="special">()()</phrase></code>) object containing the unit of code to
- be execute by a <emphasis>asynchronous-executor</emphasis>. Function <code><phrase
+ be execute by a <emphasis>execution-policy</emphasis>. Function <code><phrase
role="identifier">get_future</phrase><phrase role="special">()</phrase></code>
returns a <emphasis>asynchronous-completion-token</emphasis> allowing to wait
for the completion of the computation of the task, for getting the result of
@@ -586,11 +682,11 @@
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// get handle associated with the task
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
</phrase> <phrase role="identifier">cooperative</phrase><phrase role="special">,</phrase>
- <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// throws boost::task::task_interrupted
+ <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// throws boost::task::task_interrupted
</phrase><phrase role="special">}</phrase>
</programlisting>
</para>
@@ -616,10 +712,10 @@
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">void</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// get handle associated with the task
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
-</phrase> <phrase role="identifier">throwing</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">wait</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// throws std::domain_error
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
+</phrase> <phrase role="identifier">throwing</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">wait</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// throws std::domain_error
</phrase><phrase role="special">}</phrase>
</programlisting>
</para>
@@ -722,7 +818,7 @@
Top-level tasks have no parent. A parent task can create child tasks when it
creates another task by using <code><phrase role="identifier">boost</phrase><phrase
role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">as_sub_task</phrase></code> as <emphasis>asynchronous-executor</emphasis>.
+ role="identifier">as_sub_task</phrase></code> as <emphasis>execution-policy</emphasis>.
These children are implicitly treated as <emphasis>sub-tasks</emphasis> of
the larger task. It is assumed that that <emphasis>sub-tasks</emphasis> can
be executed in any order because only overall operation speed matters (enabling
@@ -744,18 +840,18 @@
<phrase role="special">{</phrase>
<phrase role="comment">// submit a sub-task to pool calculating fibonacci(n-1)
</phrase> <phrase role="identifier">h1</phrase> <phrase role="special">=</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">(),</phrase> <phrase role="comment">// execute a sub-task
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
<phrase role="identifier">n</phrase> <phrase role="special">-</phrase> <phrase role="number">1</phrase><phrase role="special">,</phrase>
<phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
<phrase role="comment">// submit a sub-task to pool calculating fibonacci(n-2)
</phrase> <phrase role="identifier">h2</phrase> <phrase role="special">=</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">(),</phrase> <phrase role="comment">// execute a sub-task
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
<phrase role="identifier">n</phrase> <phrase role="special">-</phrase> <phrase role="number">2</phrase><phrase role="special">,</phrase>
<phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
<phrase role="comment">// calculate fibonacci(n) from the results of both sub-tasks
</phrase> <phrase role="keyword">return</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">+</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">();</phrase>
<phrase role="special">}</phrase>
@@ -763,14 +859,14 @@
<phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// handle for fibonacci calculation
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// handle for fibonacci calculation
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">(),</phrase> <phrase role="comment">// access the default thread-pool
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// calculate fibonacci number 10
-</phrase> <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase> <phrase role="comment">// for numbers < 5 do inline recursive calculation
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// calculate fibonacci number 10
+</phrase> <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase> <phrase role="comment">// for numbers < 5 do inline recursive calculation
</phrase> <phrase role="number">10</phrase><phrase role="special">,</phrase>
- <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+ <phrase role="number">5</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// access the default thread-pool
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
@@ -794,11 +890,12 @@
<code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase></code>
represents an <emphasis>asynchronous-completion-token</emphasis>. It will be
- returned by <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase
- role="special">()</phrase></code> and is associated with the submitted <code><phrase
- role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase></code>.
+ returned by <link linkend="boost_task.async"><code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">async</phrase><phrase role="special">()</phrase></code></link>
+ and is associated with the submitted <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase></code>.
</para>
<anchor id="boost_task.handle.asynchronous_completion_token_interface"/>
<bridgehead renderas="sect3">
@@ -808,13 +905,13 @@
<para>
<code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase></code>
- implements an interface in order to check the state of computation and result
- transfer
+ implements an interface in order to check the state of computation and to transfer
+ the result.
</para>
<itemizedlist>
<listitem>
<code><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase></code>:
- return id of the associated task-id
+ return id of the associated <emphasis>task-id</emphasis>
</listitem>
<listitem>
<code><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase></code>:
@@ -830,7 +927,7 @@
</listitem>
<listitem>
<code><phrase role="identifier">get</phrase><phrase role="special">()</phrase></code>:
- return value-result
+ return value-result or throw the exception-result
</listitem>
<listitem>
<code><phrase role="identifier">wait</phrase><phrase role="special">()</phrase></code>:
@@ -849,23 +946,15 @@
<programlisting><phrase role="keyword">long</phrase> <phrase role="identifier">fibonacci</phrase><phrase role="special">(</phrase> <phrase role="keyword">long</phrase> <phrase role="identifier">n</phrase><phrase role="special">)</phrase>
<phrase role="special">{</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_thread</phrase><phrase role="special">::</phrase><phrase role="identifier">interruption_point</phrase><phrase role="special">();</phrase> <phrase role="comment">// interruption point
-</phrase>
<phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">==</phrase> <phrase role="number">0</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase>
<phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">==</phrase> <phrase role="number">1</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="number">1</phrase><phrase role="special">;</phrase>
<phrase role="keyword">long</phrase> <phrase role="identifier">k1</phrase><phrase role="special">(</phrase> <phrase role="number">1</phrase><phrase role="special">),</phrase> <phrase role="identifier">k2</phrase><phrase role="special">(</phrase> <phrase role="number">0</phrase><phrase role="special">);</phrase>
<phrase role="keyword">for</phrase> <phrase role="special">(</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">i</phrase><phrase role="special">(</phrase> <phrase role="number">2</phrase><phrase role="special">);</phrase> <phrase role="identifier">i</phrase> <phrase role="special"><=</phrase> <phrase role="identifier">n</phrase><phrase role="special">;</phrase> <phrase role="special">++</phrase><phrase role="identifier">i</phrase><phrase role="special">)</phrase>
<phrase role="special">{</phrase>
- <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_thread</phrase><phrase role="special">::</phrase><phrase role="identifier">interruption_requested</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="comment">// check if interruption was requested
-</phrase> <phrase role="keyword">return</phrase><phrase role="special">;</phrase>
-
<phrase role="keyword">long</phrase> <phrase role="identifier">tmp</phrase><phrase role="special">(</phrase> <phrase role="identifier">k1</phrase><phrase role="special">);</phrase>
<phrase role="identifier">k1</phrase> <phrase role="special">=</phrase> <phrase role="identifier">k1</phrase> <phrase role="special">+</phrase> <phrase role="identifier">k2</phrase><phrase role="special">;</phrase>
<phrase role="identifier">k2</phrase> <phrase role="special">=</phrase> <phrase role="identifier">tmp</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
-
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_thread</phrase><phrase role="special">::</phrase><phrase role="identifier">interruption_point</phrase><phrase role="special">();</phrase> <phrase role="comment">// interruption point
-</phrase>
<phrase role="keyword">return</phrase> <phrase role="identifier">k1</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
@@ -873,10 +962,10 @@
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">fibonacci</phrase><phrase role="special">,</phrase>
- <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"id == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"is ready == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
<phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">wait</phrase><phrase role="special">();</phrase>
@@ -890,6 +979,31 @@
<bridgehead renderas="sect3">
<link linkend="boost_task.handle.task_interruption">Task interruption</link>
</bridgehead>
+ <para>
+ Each invokation of <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase
+ role="special">()</phrase></code> returns an <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">handle</phrase></code> which allows to control the associated
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase></code>
+ (passed to <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase
+ role="special">()</phrase></code>). This includes the ability to interrupt
+ an <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase></code>
+ if it is cooperative. Cooperative means that the <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase></code> contains <emphasis>interruption-points</emphasis>
+ or checks for interruption requests
+ <footnote>
+ <para>
+ see <ulink url="http://www.ddj.com/architect/207100682">'Interrupt Politely'</ulink>,
+ Herb Sutter
+ </para>
+ </footnote>
+ .
+ </para>
<itemizedlist>
<listitem>
<code><phrase role="identifier">interrupt</phrase><phrase role="special">()</phrase></code>:
@@ -918,7 +1032,7 @@
role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
role="identifier">task</phrase><phrase role="special">::</phrase><phrase
role="identifier">task</phrase></code> was removed from <emphasis>worker-thread</emphasis>
- or time point has elapsed
+ or time point has reached
</listitem>
<listitem>
<code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
@@ -932,7 +1046,7 @@
<programlisting><phrase role="keyword">long</phrase> <phrase role="identifier">cooperative</phrase><phrase role="special">(</phrase> <phrase role="keyword">long</phrase> <phrase role="identifier">n</phrase><phrase role="special">)</phrase>
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_thread</phrase><phrase role="special">::</phrase><phrase role="identifier">interruption_point</phrase><phrase role="special">();</phrase> <phrase role="comment">// interruption point
-</phrase>
+</phrase>
<phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">==</phrase> <phrase role="number">0</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase>
<phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">==</phrase> <phrase role="number">1</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="number">1</phrase><phrase role="special">;</phrase>
<phrase role="keyword">long</phrase> <phrase role="identifier">k1</phrase><phrase role="special">(</phrase> <phrase role="number">1</phrase><phrase role="special">),</phrase> <phrase role="identifier">k2</phrase><phrase role="special">(</phrase> <phrase role="number">0</phrase><phrase role="special">);</phrase>
@@ -940,26 +1054,26 @@
<phrase role="special">{</phrase>
<phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_thread</phrase><phrase role="special">::</phrase><phrase role="identifier">interruption_requested</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="comment">// check if interruption was requested
</phrase> <phrase role="keyword">return</phrase><phrase role="special">;</phrase>
-
+
<phrase role="keyword">long</phrase> <phrase role="identifier">tmp</phrase><phrase role="special">(</phrase> <phrase role="identifier">k1</phrase><phrase role="special">);</phrase>
<phrase role="identifier">k1</phrase> <phrase role="special">=</phrase> <phrase role="identifier">k1</phrase> <phrase role="special">+</phrase> <phrase role="identifier">k2</phrase><phrase role="special">;</phrase>
<phrase role="identifier">k2</phrase> <phrase role="special">=</phrase> <phrase role="identifier">tmp</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
-
+
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_thread</phrase><phrase role="special">::</phrase><phrase role="identifier">interruption_point</phrase><phrase role="special">();</phrase> <phrase role="comment">// interruption point
-</phrase>
+</phrase>
<phrase role="keyword">return</phrase> <phrase role="identifier">k1</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
<phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// get handle associated with the task
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// task, to be executed asynchronously
</phrase> <phrase role="identifier">cooperative</phrase><phrase role="special">,</phrase>
- <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
- <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">interrupt_and_wait</phrase><phrase role="special">();</phrase>
+ <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// asynchronous executor
+</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">interrupt_and_wait</phrase><phrase role="special">();</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"id == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"is ready == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"has value == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
@@ -968,6 +1082,150 @@
</phrase><phrase role="special">}</phrase>
</programlisting>
</para>
+ <note>
+ <para>
+ If the task is still pending when an interruption is requested - the task
+ is not removed from the queue, it is marked to be interrupted instead.
+ </para>
+ </note>
+ <anchor id="boost_task.handle.waiting_for_handles"/>
+ <bridgehead renderas="sect3">
+ <link linkend="boost_task.handle.waiting_for_handles">Waiting for handles</link>
+ </bridgehead>
+ <para>
+ <emphasis role="bold">Boost.Task</emphasis> provides function <code><phrase
+ role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">waitfor_all</phrase><phrase
+ role="special">()</phrase></code> waits for all handles passed to this function
+ to become ready
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">vector</phrase> <phrase role="identifier">handles</phrase><phrase role="special"><</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="special">></phrase> <phrase role="identifier">results</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">results</phrase><phrase role="special">.</phrase><phrase role="identifier">reserve</phrase><phrase role="special">(</phrase> <phrase role="number">10</phrase><phrase role="special">);</phrase>
+
+ <phrase role="keyword">for</phrase> <phrase role="special">(</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">i</phrase> <phrase role="special">=</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase> <phrase role="identifier">i</phrase> <phrase role="special"><</phrase> <phrase role="number">10</phrase><phrase role="special">;</phrase> <phrase role="special">++</phrase><phrase role="identifier">i</phrase><phrase role="special">)</phrase>
+ <phrase role="identifier">results</phrase><phrase role="special">.</phrase><phrase role="identifier">push_back</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">fibonacci</phrase><phrase role="special">,</phrase>
+ <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
+ <phrase role="comment">// wait until all tasks are ready
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">results</phrase><phrase role="special">.</phrase><phrase role="identifier">begin</phrase><phrase role="special">(),</phrase> <phrase role="identifier">results</phrase><phrase role="special">.</phrase><phrase role="identifier">end</phrase><phrase role="special">()</phrase> <phrase role="special">);</phrase>
+
+ <phrase role="keyword">int</phrase> <phrase role="identifier">k</phrase> <phrase role="special">=</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">vector</phrase><phrase role="special"><</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="special">>::</phrase><phrase role="identifier">iterator</phrase> <phrase role="identifier">e</phrase><phrase role="special">(</phrase> <phrase role="identifier">results</phrase><phrase role="special">.</phrase><phrase role="identifier">end</phrase><phrase role="special">()</phrase> <phrase role="special">);</phrase>
+ <phrase role="keyword">for</phrase> <phrase role="special">(</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">vector</phrase><phrase role="special"><</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="special">>::</phrase><phrase role="identifier">iterator</phrase> <phrase role="identifier">i</phrase><phrase role="special">(</phrase> <phrase role="identifier">results</phrase><phrase role="special">.</phrase><phrase role="identifier">begin</phrase><phrase role="special">()</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">i</phrase> <phrase role="special">!=</phrase> <phrase role="identifier">e</phrase><phrase role="special">;</phrase>
+ <phrase role="special">++</phrase><phrase role="identifier">i</phrase><phrase role="special">)</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci("</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">k</phrase><phrase role="special">++</phrase> <phrase role="special"><<</phrase> <phrase role="string">") == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">i</phrase><phrase role="special">-></phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+<phrase role="special">}</phrase>
+</programlisting>
+ </para>
+ <para>
+ and <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">waitfor_any</phrase><phrase
+ role="special">()</phrase></code> which returns if at least one of the passed
+ handles becomes ready.
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h1</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">cooperative</phrase><phrase role="special">,</phrase>
+ <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h2</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">cooperative</phrase><phrase role="special">,</phrase>
+ <phrase role="number">7</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h3</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">cooperative</phrase><phrase role="special">,</phrase>
+ <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
+ <phrase role="comment">// wait for any task becomes ready
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">h1</phrase><phrase role="special">,</phrase> <phrase role="identifier">h2</phrase><phrase role="special">,</phrase> <phrase role="identifier">h3</phrase><phrase role="special">);</phrase>
+
+ <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(10) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+ <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(7) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+ <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">h3</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(5) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h3</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+<phrase role="special">}</phrase>
+</programlisting>
+ </para>
+ </section>
+ <section id="boost_task.async">
+ <title><link linkend="boost_task.async"> Asynchronous execution</link></title>
+ <para>
+ The function <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase
+ role="special">()</phrase></code> passes the <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase></code> to the <emphasis>execution-policy</emphasis>
+ which executes the <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase></code>
+ (for this purpose <emphasis>execution-policy</emphasis> is required to provide
+ <code><phrase role="identifier">handle</phrase><phrase role="special"><</phrase>
+ <phrase role="identifier">R</phrase> <phrase role="special">></phrase>
+ <phrase role="keyword">operator</phrase><phrase role="special">()(</phrase>
+ <phrase role="identifier">task</phrase><phrase role="special"><</phrase>
+ <phrase role="identifier">R</phrase> <phrase role="special">></phrase>
+ <phrase role="identifier">tsk</phrase><phrase role="special">)</phrase></code>).
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase
+ role="special">()</phrase></code> accepts two arguments - the first is an
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase></code>
+ object and the second an <emphasis>execution-policy</emphasis>. For the second
+ argument <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase></code>
+ is used per default. The function returns a <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">handle</phrase></code> which controls the submitted <code><phrase
+ role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase></code>.
+ </para>
+ <para>
+
+<programlisting><phrase role="keyword">long</phrase> <phrase role="identifier">fibonacci</phrase><phrase role="special">(</phrase> <phrase role="keyword">long</phrase> <phrase role="identifier">n</phrase><phrase role="special">)</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">==</phrase> <phrase role="number">0</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase>
+ <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">==</phrase> <phrase role="number">1</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="number">1</phrase><phrase role="special">;</phrase>
+ <phrase role="keyword">long</phrase> <phrase role="identifier">k1</phrase><phrase role="special">(</phrase> <phrase role="number">1</phrase><phrase role="special">),</phrase> <phrase role="identifier">k2</phrase><phrase role="special">(</phrase> <phrase role="number">0</phrase><phrase role="special">);</phrase>
+ <phrase role="keyword">for</phrase> <phrase role="special">(</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">i</phrase><phrase role="special">(</phrase> <phrase role="number">2</phrase><phrase role="special">);</phrase> <phrase role="identifier">i</phrase> <phrase role="special"><=</phrase> <phrase role="identifier">n</phrase><phrase role="special">;</phrase> <phrase role="special">++</phrase><phrase role="identifier">i</phrase><phrase role="special">)</phrase>
+ <phrase role="special">{</phrase>
+ <phrase role="keyword">long</phrase> <phrase role="identifier">tmp</phrase><phrase role="special">(</phrase> <phrase role="identifier">k1</phrase><phrase role="special">);</phrase>
+ <phrase role="identifier">k1</phrase> <phrase role="special">=</phrase> <phrase role="identifier">k1</phrase> <phrase role="special">+</phrase> <phrase role="identifier">k2</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">k2</phrase> <phrase role="special">=</phrase> <phrase role="identifier">tmp</phrase><phrase role="special">;</phrase>
+ <phrase role="special">}</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="identifier">k1</phrase><phrase role="special">;</phrase>
+<phrase role="special">}</phrase>
+
+<phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// get handle associated with the task
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// compute fibonacci(10) asynchron
+</phrase> <phrase role="identifier">fibonacci</phrase><phrase role="special">,</phrase>
+ <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"id == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(10) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// throws boost::task::task_interrupted
+</phrase><phrase role="special">}</phrase>
+</programlisting>
+ </para>
</section>
<section id="boost_task.own_thread">
<title><link linkend="boost_task.own_thread"> Execute in own thread</link></title>
@@ -998,10 +1256,10 @@
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">own_thread</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">fibonacci</phrase><phrase role="special">,</phrase>
- <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">own_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(10) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
@@ -1015,17 +1273,12 @@
creates a new <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
role="identifier">thread</phrase></code> and executes the task in this thread
(asynchronous). The created thread gets joined by handle (so <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2802.html">N2802</ulink>
- should be addressed).
+ should be addressed). The returned <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">handle</phrase></code> joins the thread in its destructor
+ (if the last reference gets out of scope) and thus provides one possible solution
+ of <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html">N2880</ulink>.
</para>
- <caution>
- <para>
- Always store the returned <emphasis>asynchronous-completion-token</emphasis>
- in a variable because <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">handle</phrase></code>
- joins the thread in its destructor (if the last reference gets out of scope).
- </para>
- </caution>
<para>
<programlisting><phrase role="keyword">long</phrase> <phrase role="identifier">fibonacci</phrase><phrase role="special">(</phrase> <phrase role="keyword">long</phrase> <phrase role="identifier">n</phrase><phrase role="special">)</phrase>
@@ -1046,14 +1299,23 @@
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">fibonacci</phrase><phrase role="special">,</phrase>
- <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(10) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
+ <caution>
+ <para>
+ Always store the returned <emphasis>asynchronous-completion-token</emphasis>
+ in a variable because <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">handle</phrase></code>
+ joins the thread in its destructor (if the last reference gets out of scope).
+ </para>
+ </caution>
<para>
In the example below both <code><phrase role="identifier">a_function</phrase><phrase
role="special">()</phrase></code> and <code><phrase role="identifier">another_function</phrase><phrase
@@ -1065,14 +1327,12 @@
<para>
<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">a_function</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">a_function</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">another_function</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">another_function</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
</programlisting>
</para>
</section>
@@ -1110,10 +1370,10 @@
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">echo</phrase><phrase role="special">,</phrase>
- <phrase role="string">"Hello World!"</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="string">"Hello World!"</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
@@ -1139,14 +1399,13 @@
<phrase role="special">{</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">,</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">echo</phrase><phrase role="special">,</phrase>
- <phrase role="string">"Hello World!"</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="string">"Hello World!"</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
- .
</para>
<important>
<para>
@@ -1315,14 +1574,14 @@
</phrase><phrase role="special">></phrase> <phrase role="identifier">pool</phrase><phrase role="special">(</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">poolsize</phrase><phrase role="special">(</phrase> <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">,</phrase> <phrase role="comment">// thread-pool
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">some_fn</phrase><phrase role="special">),</phrase> <phrase role="comment">// task to be executed
-</phrase> <phrase role="number">5</phrase><phrase role="special">);</phrase> <phrase role="comment">// priority is 5
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">some_fn</phrase><phrase role="special">),</phrase> <phrase role="comment">// task to be executed
+</phrase> <phrase role="number">5</phrase><phrase role="special">,</phrase> <phrase role="comment">// priority is 5
+</phrase> <phrase role="identifier">pool</phrase><phrase role="special">);</phrase> <phrase role="comment">// thread-pool
</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">,</phrase> <phrase role="comment">// thread-pool
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">another_fn</phrase><phrase role="special">),</phrase> <phrase role="comment">// task to be executed
-</phrase> <phrase role="number">3</phrase><phrase role="special">);</phrase> <phrase role="comment">// priority is 3
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">another_fn</phrase><phrase role="special">),</phrase> <phrase role="comment">// task to be executed
+</phrase> <phrase role="number">3</phrase><phrase role="special">,</phrase> <phrase role="comment">// priority is 3
+</phrase> <phrase role="identifier">pool</phrase><phrase role="special">);</phrase> <phrase role="comment">// thread-pool
</phrase></programlisting>
</para>
<para>
@@ -1407,16 +1666,17 @@
<phrase role="comment">// replaced by later task with same attribute == 2
</phrase> <phrase role="comment">// if still pending in pool
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">,</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">10</phrase><phrase role="special">),</phrase>
- <phrase role="number">2</phrase><phrase role="special">);</phrase> <phrase role="comment">// attribute is 2
-</phrase>
+ <phrase role="number">2</phrase><phrase role="special">,</phrase> <phrase role="comment">// attribute is 2
+</phrase> <phrase role="identifier">pool</phrase><phrase role="special">);</phrase>
+
<phrase role="comment">// will replace previous pending task with attribute == 2
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
<phrase role="identifier">pool</phrase><phrase role="special">,</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">5</phrase><phrase role="special">),</phrase>
- <phrase role="number">2</phrase><phrase role="special">);</phrase> <phrase role="comment">// attribute is 2 too
-</phrase><phrase role="special">}</phrase>
+ <phrase role="number">2</phrase><phrase role="special">,</phrase> <phrase role="comment">// attribute is 2 too
+</phrase> <phrase role="identifier">pool</phrase><phrase role="special">);</phrase>
+<phrase role="special">}</phrase>
</programlisting>
</para>
</section>
@@ -1442,12 +1702,6 @@
are joined until all pending tasks are processed. No futher tasks can be
submitted.
</para>
- <note>
- <para>
- The deconstructor calls <code><phrase role="identifier">shutdown</phrase><phrase
- role="special">()</phrase></code> if the pool was not shutdown yet.
- </para>
- </note>
<para>
<programlisting><phrase role="keyword">long</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">(</phrase> <phrase role="keyword">long</phrase> <phrase role="identifier">n</phrase><phrase role="special">)</phrase>
@@ -1478,14 +1732,14 @@
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h1</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">,</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h2</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">,</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">5</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase>
<phrase role="identifier">pool</phrase><phrase role="special">.</phrase><phrase role="identifier">shutdown</phrase><phrase role="special">();</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(10) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
@@ -1493,6 +1747,12 @@
<phrase role="special">}</phrase>
</programlisting>
</para>
+ <note>
+ <para>
+ The deconstructor calls <code><phrase role="identifier">shutdown</phrase><phrase
+ role="special">()</phrase></code> if the pool was not shutdown yet.
+ </para>
+ </note>
<anchor id="boost_task.pool.pool_shutdown.shutdown_immediatly"/>
<bridgehead renderas="sect4">
<link linkend="boost_task.pool.pool_shutdown.shutdown_immediatly">Shutdown
@@ -1533,14 +1793,14 @@
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h1</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">,</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h2</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">,</phrase> <phrase role="comment">// asynchronous executor
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">5</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy
+</phrase>
<phrase role="identifier">pool</phrase><phrase role="special">.</phrase><phrase role="identifier">shutdown_now</phrase><phrase role="special">();</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(10) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase> <phrase role="comment">// may throw broken_task or task_interrupted
@@ -1596,14 +1856,14 @@
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h1</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">(),</phrase> <phrase role="comment">// asynchronous executor == default-pool
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy == default-pool
+</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h2</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">(),</phrase> <phrase role="comment">// asynchronous executor == default-pool
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci_fn</phrase><phrase role="special">,</phrase> <phrase role="number">5</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// execution-policy == default-pool
+</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(10) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="string">"\n"</phrase><phrase role="special">;</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"fibonacci(5) == "</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
@@ -1760,18 +2020,20 @@
<phrase role="special">{</phrase>
<phrase role="comment">// fork a sub-task calculating fibonacci(n-1)
</phrase> <phrase role="identifier">h1</phrase> <phrase role="special">=</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
<phrase role="identifier">n</phrase> <phrase role="special">-</phrase> <phrase role="number">1</phrase><phrase role="special">,</phrase>
- <phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">cutof</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">()</phrase> <phrase role="special">);</phrase>
+
<phrase role="comment">// fork a sub-task calculating fibonacci(n-2)
</phrase> <phrase role="identifier">h2</phrase> <phrase role="special">=</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
<phrase role="identifier">n</phrase> <phrase role="special">-</phrase> <phrase role="number">2</phrase><phrase role="special">,</phrase>
- <phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+ <phrase role="identifier">cutof</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">()</phrase> <phrase role="special">);</phrase>
+
<phrase role="comment">// join the results of both sub-tasks
</phrase> <phrase role="comment">// if one of the both sub-tasks is not ready
</phrase> <phrase role="comment">// the worker-thread does not block, it executes other
@@ -1782,14 +2044,14 @@
<phrase role="keyword">void</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// handle for fibonacci calculation
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase> <phrase role="comment">// handle for fibonacci calculation
</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">(),</phrase> <phrase role="comment">// access the default thread-pool
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// calculate fibonacci number 10
-</phrase> <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase> <phrase role="comment">// for numbers < 5 do inline recursive calculation
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="comment">// calculate fibonacci number 10
+</phrase> <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase> <phrase role="comment">// for numbers < 5 do inline recursive calculation
</phrase> <phrase role="number">10</phrase><phrase role="special">,</phrase>
- <phrase role="number">5</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+ <phrase role="number">5</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">default_pool</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// access the default thread-pool
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special"><<</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
@@ -1804,32 +2066,20 @@
task is executed inside a <emphasis>thread-pool</emphasis> the <emphasis>sub-task</emphasis>
is put into the local-queue of the <emphasis>worker-thread</emphasis> in the
other case the <emphasis>sub-task</emphasis> will be executed in a new thread.
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase></code>
+ is used as default <emphasis>execution-policy</emphasis> for <code><phrase
+ role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">()</phrase></code>,
</para>
<para>
<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="keyword">long</phrase> <phrase role="special">></phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">(),</phrase>
<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(</phrase>
<phrase role="identifier">fibonacci</phrase><phrase role="special">,</phrase>
- <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
-</programlisting>
- </para>
- <para>
- is equivalent to:
- </para>
- <para>
-
-<programlisting><phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">this_task</phrase><phrase role="special">::</phrase><phrase role="identifier">runs_in_pool</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase>
-<phrase role="special">{</phrase>
- <phrase role="comment">// put the sub-task into worker-threads local-queue
-</phrase><phrase role="special">}</phrase>
-<phrase role="keyword">else</phrase>
-<phrase role="special">{</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">new_thread</phrase><phrase role="special">(),</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">make_task</phrase><phrase role="special">(...)</phrase> <phrase role="special">);</phrase>
-<phrase role="special">}</phrase>
+ <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">as_sub_task</phrase><phrase role="special">()</phrase> <phrase role="special">)</phrase> <phrase role="special">);</phrase>
</programlisting>
</para>
</section>
@@ -1982,123 +2232,165 @@
<phrase role="keyword">void</phrase> <phrase role="identifier">swap</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">other</phrase><phrase role="special">)</phrase> <phrase role="comment">// throw();
</phrase>
<phrase role="keyword">void</phrase> <phrase role="keyword">operator</phrase><phrase role="special">()()</phrase> <phrase role="comment">// throw();
-</phrase><phrase role="special">}</phrase>
+</phrase><phrase role="special">};</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Fn</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">A0</phrase> <phrase role="special">></phrase>
+<phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">>::</phrase><phrase role="identifier">type</phrase> <phrase role="special">></phrase> <phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">Fn</phrase> <phrase role="identifier">fn</phrase><phrase role="special">,</phrase> <phrase role="identifier">A0</phrase> <phrase role="identifier">a0</phrase><phrase role="special">);</phrase>
+
+<phrase role="special">...</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Fn</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">A0</phrase><phrase role="special">,</phrase> <phrase role="special">...,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">A10</phrase> <phrase role="special">></phrase>
+<phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">>::</phrase><phrase role="identifier">type</phrase> <phrase role="special">></phrase> <phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">Fn</phrase> <phrase role="identifier">fn</phrase><phrase role="special">,</phrase> <phrase role="identifier">A0</phrase> <phrase role="identifier">a0</phrase><phrase role="special">,</phrase> <phrase role="special">...,</phrase> <phrase role="identifier">A10</phrase> <phrase role="identifier">a10</phrase><phrase role="special">);</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.task.constructor">
- <title><link linkend="boost_task.reference.task.constructor"> Constructor</link></title>
-
+ <anchor id="boost_task.reference.task.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Fn</phrase> <phrase role="special">></phrase>
<phrase role="identifier">task</phrase><phrase role="special">(</phrase> <phrase role="identifier">Fn</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">fn</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">tp</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special"><</phrase> <phrase role="identifier">R</phrase>
- <phrase role="special">></phrase></code> from a function object
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.task.get_id">
- <title><link linkend="boost_task.reference.task.get_id"> Member function
- <code><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">tp</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special"><</phrase>
+ <phrase role="identifier">R</phrase> <phrase role="special">></phrase></code>
+ from a function object
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_">function
+ <code><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">const</phrase> <phrase role="identifier">id</phrase> <phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns task identifier
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.task.get_future">
- <title><link linkend="boost_task.reference.task.get_future"> Member function
- <code><phrase role="identifier">get_future</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns task identifier
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.member_function__code__phrase_role__identifier__get_future__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.member_function__code__phrase_role__identifier__get_future__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">get_future</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">shared_future</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">get_future</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns a future assiciated with the task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- ???
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.task.swap">
- <title><link linkend="boost_task.reference.task.swap"> Member function <code><phrase
- role="identifier">swap</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns a future assiciated with the task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ ???
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">swap</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">swap</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">other</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- swaps the task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.task.operator">
- <title><link linkend="boost_task.reference.task.operator"> Member function
- <code><phrase role="keyword">operator</phrase><phrase role="special">()()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ swaps the task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special________phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special________phrase___code_">Member
+ function <code><phrase role="keyword">operator</phrase><phrase role="special">()()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="keyword">operator</phrase><phrase role="special">()()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- executes tasks internal function object
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ executes tasks internal function object
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.free_function__code__phrase_role__identifier__make_task__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.free_function__code__phrase_role__identifier__make_task__phrase__phrase_role__special______phrase___code_">Free
+ function <code><phrase role="identifier">make_task</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Fn</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">A0</phrase> <phrase role="special">></phrase>
+<phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">>::</phrase><phrase role="identifier">type</phrase> <phrase role="special">></phrase> <phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">Fn</phrase> <phrase role="identifier">fn</phrase><phrase role="special">,</phrase> <phrase role="identifier">A0</phrase> <phrase role="identifier">a0</phrase><phrase role="special">);</phrase>
+
+<phrase role="special">...</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Fn</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">A0</phrase><phrase role="special">,</phrase> <phrase role="special">...,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">A10</phrase> <phrase role="special">></phrase>
+<phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">>::</phrase><phrase role="identifier">type</phrase> <phrase role="special">></phrase> <phrase role="identifier">make_task</phrase><phrase role="special">(</phrase> <phrase role="identifier">Fn</phrase> <phrase role="identifier">fn</phrase><phrase role="special">,</phrase> <phrase role="identifier">A0</phrase> <phrase role="identifier">a0</phrase><phrase role="special">,</phrase> <phrase role="special">...,</phrase> <phrase role="identifier">A10</phrase> <phrase role="identifier">a10</phrase><phrase role="special">);</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ creates an task from function object and arguments
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.handle">
<title><link linkend="boost_task.reference.handle"> Class template <code><phrase
@@ -2135,400 +2427,537 @@
<phrase role="keyword">void</phrase> <phrase role="identifier">wait</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">shared_future</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">get_future</phrase><phrase role="special">();</phrase>
+
<phrase role="keyword">void</phrase> <phrase role="identifier">swap</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">other</phrase><phrase role="special">);</phrase>
<phrase role="special">};</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">begin</phrase><phrase role="special">,</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">end</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <p
hrase role="identifier">T4</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T4</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <p
hrase role="identifier">T4</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">begin</phrase><phrase role="special">,</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">end</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">unsigned</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">unsigned</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">unsigned</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase
><phrase role="special"><</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T4</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">unsigned</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase
><phrase role="special"><</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.handle.constructor">
- <title><link linkend="boost_task.reference.handle.constructor"> Constructor</link></title>
-
+ <anchor id="boost_task.reference.handle.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">handle</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs an empty (invalid) handle
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.get_id">
- <title><link linkend="boost_task.reference.handle.get_id"> Member function
- <code><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs an empty (invalid) handle
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">const</phrase> <phrase role="identifier">id</phrase> <phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns identifier of the associated task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.interruption_requested">
- <title><link linkend="boost_task.reference.handle.interruption_requested">
- Member function <code><phrase role="identifier">interruption_requested</phrase><phrase
- role="special">()</phrase></code></link></title>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns identifier of the associated task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__interruption_requested__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__interruption_requested__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">interruption_requested</phrase><phrase
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">bool</phrase> <phrase role="identifier">interruption_requested</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- checks if interruption is already requested
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.interrupt">
- <title><link linkend="boost_task.reference.handle.interrupt"> Member function
- <code><phrase role="identifier">interrupt</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ checks if interruption is already requested
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">interrupt</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">interrupt</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- requests task interruption; doesn not block (immediatly returns)
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- ???
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.interrupt_and_wait">
- <title><link linkend="boost_task.reference.handle.interrupt_and_wait"> Member
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ requests task interruption; doesn not block (immediatly returns)
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ ???
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait__phrase__phrase_role__special______phrase___code_">Member
function <code><phrase role="identifier">interrupt_and_wait</phrase><phrase
- role="special">()</phrase></code></link></title>
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">interrupt_and_wait</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- requests task interruption and blocks until worker-thread stops task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- ???
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.interrupt_and_wait_until">
- <title><link linkend="boost_task.reference.handle.interrupt_and_wait_until">
- Member function <code><phrase role="identifier">interrupt_and_wait_until</phrase><phrase
- role="special">()</phrase></code></link></title>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ requests task interruption and blocks until worker-thread stops task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ ???
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait_until__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait_until__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">interrupt_and_wait_until</phrase><phrase
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">interrupt_and_wait_until</phrase><phrase role="special">(</phrase> <phrase role="identifier">system_time</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">abs_time</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- requests task interruption and blocks until worker-thread stops task
- or time-point elapsed
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- ???
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.interrupt_and_wait_for">
- <title><link linkend="boost_task.reference.handle.interrupt_and_wait_for">
- Member function <code><phrase role="identifier">interrupt_and_wait_for</phrase><phrase
- role="special">()</phrase></code></link></title>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ requests task interruption and blocks until worker-thread stops task
+ or time-point elapsed
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ ???
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait_for__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait_for__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">interrupt_and_wait_for</phrase><phrase
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Duration</phrase> <phrase role="special">></phrase>
<phrase role="keyword">void</phrase> <phrase role="identifier">interrupt_and_wait_for</phrase><phrase role="special">(</phrase> <phrase role="identifier">Duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">rel_time</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- requests task interruption and blocks until worker-thread stops task
- or time-duration elapsed
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- ???
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.get">
- <title><link linkend="boost_task.reference.handle.get"> Member function
- <code><phrase role="identifier">get</phrase><phrase role="special">()</phrase></code></link></title>
-
-<programlisting><phrase role="identifier">R</phrase> <phrase role="identifier">get</phrase><phrase role="special">()</phrase>
-</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- requests the result
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- task_interrupted, task_uninialized
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.wait">
- <title><link linkend="boost_task.reference.handle.wait"> Member function
- <code><phrase role="identifier">wait</phrase><phrase role="special">()</phrase></code></link></title>
-
-<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">wait</phrase><phrase role="special">()</phrase>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ requests task interruption and blocks until worker-thread stops task
+ or time-duration elapsed
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ ???
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__get__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__get__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">get</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="identifier">R</phrase> <phrase role="identifier">get</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- blocks caller until task is done
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- task_interrupted, task_uninialized
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.is_ready">
- <title><link linkend="boost_task.reference.handle.is_ready"> Member function
- <code><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ requests the result
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ task_interrupted, task_uninialized
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">wait</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">wait</phrase><phrase role="special">()</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ blocks caller until task is done
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ task_interrupted, task_uninialized
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__is_ready__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__is_ready__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">bool</phrase> <phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- checks if task is done
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.has_value">
- <title><link linkend="boost_task.reference.handle.has_value"> Member function
- <code><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ checks if task is done
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__has_value__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__has_value__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">bool</phrase> <phrase role="identifier">has_value</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- checks if task is done and a result value is set
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.has_exception">
- <title><link linkend="boost_task.reference.handle.has_exception"> Member
- function <code><phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ checks if task is done and a result value is set
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__has_exception__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__has_exception__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">bool</phrase> <phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- checks if task is done and an exception is set
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.handle.swap">
- <title><link linkend="boost_task.reference.handle.swap"> Member function
- <code><phrase role="identifier">swap</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ checks if task is done and an exception is set
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__get_future__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__get_future__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">get_future</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="identifier">shared_future</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">get_future</phrase><phrase role="special">()</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns a reference to the internal shared_future< R >
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">swap</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">swap</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">other</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- swapps handle
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ swapps handle
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.non_member_function__code__phrase_role__identifier__wait_for_all__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.non_member_function__code__phrase_role__identifier__wait_for_all__phrase__phrase_role__special______phrase___code_">Non-member
+ function <code><phrase role="identifier">wait_for_all</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">begin</phrase><phrase role="special">,</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">end</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <p
hrase role="identifier">T4</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T4</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <p
hrase role="identifier">T4</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ waits for all handles to become ready
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.non_member_function__code__phrase_role__identifier__wait_for_any__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.non_member_function__code__phrase_role__identifier__wait_for_any__phrase__phrase_role__special______phrase___code_">Non-member
+ function <code><phrase role="identifier">wait_for_any</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">begin</phrase><phrase role="special">,</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="identifier">end</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">unsigned</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">unsigned</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">unsigned</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase
><phrase role="special"><</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T3</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T4</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">></phrase>
+<phrase role="keyword">friend</phrase> <phrase role="keyword">unsigned</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">waitfor_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase
><phrase role="special"><</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ waits for any handle to become ready
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.async">
- <title><link linkend="boost_task.reference.async"> Function <code><phrase role="identifier">async</phrase><phrase
- role="special">()</phrase></code></link></title>
- <section id="boost_task.reference.async.async_default">
- <title><link linkend="boost_task.reference.async.async_default"> Templated
- non-member function <code><phrase role="identifier">async</phrase><phrase
- role="special">(</phrase> <phrase role="identifier">AE</phrase><phrase role="special">,</phrase>
- <phrase role="identifier">task</phrase><phrase role="special"><</phrase>
- <phrase role="identifier">R</phrase> <phrase role="special">>)</phrase></code></link></title>
- <para>
-
+ <title><link linkend="boost_task.reference.async"> Non-member function <code><phrase
+ role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase
+ role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">>,</phrase>
+ <phrase role="identifier">EP</phrase><phrase role="special">)</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">async</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
-<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">AE</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase>
-<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">AE</phrase> <phrase role="identifier">ae</phrase><phrase role="special">,</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">t</phrase><phrase role="special">);</phrase>
+<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">EP</phrase> <phrase role="special">></phrase>
+<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">t</phrase><phrase role="special">,</phrase> <phrase role="identifier">EP</phrase> <phrase role="identifier">ep</phrase><phrase role="special">);</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- executes task in an asyncrounous executer and returns a handle associated
- with the task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.async.async_pool">
- <title><link linkend="boost_task.reference.async.async_pool"> Templated non-member
- function <code><phrase role="identifier">async</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special"><</phrase>
- <phrase role="identifier">Channel</phrase> <phrase role="special">></phrase>
- <phrase role="special">&,</phrase> <phrase role="identifier">task</phrase><phrase
- role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase
- role="special">>)</phrase></code></link></title>
- <para>
-
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ executes task in an asyncrounous executer and returns a handle associated
+ with the task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.async1">
+ <title><link linkend="boost_task.reference.async1"> Non-member function <code><phrase
+ role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase
+ role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">>,</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special"><</phrase>
+ <phrase role="identifier">Channel</phrase> <phrase role="special">></phrase>
+ <phrase role="special">&)</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">async</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">></phrase>
-<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">pool</phrase><phrase role="special"><</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">ae</phrase><phrase role="special">,</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">t</phrase><phrase role="special">);</phrase>
+<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">t</phrase><phrase role="special">,</phrase> <phrase role="identifier">pool</phrase><phrase role="special"><</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">ep</phrase><phrase role="special">);</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- executes task in a thread-pool and returns a handle associated with
- the task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.async.async_pool_attr">
- <title><link linkend="boost_task.reference.async.async_pool_attr"> Templated
- non-member function <code><phrase role="identifier">async</phrase><phrase
- role="special">(</phrase> <phrase role="identifier">pool</phrase><phrase
- role="special"><</phrase> <phrase role="identifier">Channel</phrase>
- <phrase role="special">></phrase> <phrase role="special">&,</phrase>
- <phrase role="identifier">task</phrase><phrase role="special"><</phrase>
- <phrase role="identifier">R</phrase> <phrase role="special">>,</phrase>
- <phrase role="identifier">Attr</phrase><phrase role="special">)</phrase></code></link></title>
- <para>
-
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ executes task in a thread-pool and returns a handle associated with the
+ task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.async2">
+ <title><link linkend="boost_task.reference.async2"> Non-member function <code><phrase
+ role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase
+ role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">>,</phrase>
+ <phrase role="identifier">Attr</phrase><phrase role="special">,</phrase> <phrase
+ role="identifier">pool</phrase><phrase role="special"><</phrase> <phrase
+ role="identifier">Channel</phrase> <phrase role="special">></phrase> <phrase
+ role="special">&)</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">async</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Channel</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Attr</phrase> <phrase role="special">></phrase>
-<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">pool</phrase><phrase role="special"><</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">ae</phrase><phrase role="special">,</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">t</phrase><phrase role="special">,</phrase> <phrase role="identifier">Attr</phrase> <phrase role="identifier">attr</phrase><phrase role="special">);</phrase>
+<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">async</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">t</phrase><phrase role="special">,</phrase> <phrase role="identifier">Attr</phrase> <phrase role="identifier">attr</phrase><phrase role="special">,</phrase> <phrase role="identifier">pool</phrase><phrase role="special"><</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">></phrase> <phrase role="special">&</phrase> <phrase role="identifier">ep</phrase><phrase role="special">);</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- executes atrributed task in a thread-pool and returns a handle associated
- with the task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ executes atrributed task in a thread-pool and returns a handle associated
+ with the task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.own_thread">
<title><link linkend="boost_task.reference.own_thread"> Class <code><phrase
@@ -2544,33 +2973,34 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.own_thread.operator">
- <title><link linkend="boost_task.reference.own_thread.operator"> Member function
- <code><phrase role="keyword">operator</phrase><phrase role="special">()(</phrase>
+ <anchor id="boost_task.reference.own_thread.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___phrase_role__identifier__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__identifier__t__phrase__phrase_role__special_____phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.own_thread.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___phrase_role__identifier__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__identifier__t__phrase__phrase_role__special_____phrase___code_">Member
+ function <code><phrase role="keyword">operator</phrase><phrase role="special">()(</phrase>
<phrase role="identifier">task</phrase><phrase role="special"><</phrase>
<phrase role="identifier">R</phrase> <phrase role="special">></phrase>
- <phrase role="identifier">t</phrase><phrase role="special">)</phrase></code></link></title>
-
+ <phrase role="identifier">t</phrase><phrase role="special">)</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase>
<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="keyword">operator</phrase><phrase role="special">()(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">t</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- executes task in the current thread an returns an handle associated
- with the task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ executes task in the current thread an returns an handle associated with
+ the task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.new_thread">
<title><link linkend="boost_task.reference.new_thread"> Class <code><phrase
@@ -2586,33 +3016,34 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.new_thread.operator">
- <title><link linkend="boost_task.reference.new_thread.operator"> Member function
- <code><phrase role="keyword">operator</phrase><phrase role="special">()(</phrase>
+ <anchor id="boost_task.reference.new_thread.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___phrase_role__identifier__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__identifier__t__phrase__phrase_role__special_____phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.new_thread.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___phrase_role__identifier__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__identifier__t__phrase__phrase_role__special_____phrase___code_">Member
+ function <code><phrase role="keyword">operator</phrase><phrase role="special">()(</phrase>
<phrase role="identifier">task</phrase><phrase role="special"><</phrase>
<phrase role="identifier">R</phrase> <phrase role="special">></phrase>
- <phrase role="identifier">t</phrase><phrase role="special">)</phrase></code></link></title>
-
+ <phrase role="identifier">t</phrase><phrase role="special">)</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase>
<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="keyword">operator</phrase><phrase role="special">()(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">t</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- executes task in a new thread an returns an handle associated with
- the task
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ executes task in a new thread an returns an handle associated with the
+ task
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.static_pool">
<title><link linkend="boost_task.reference.static_pool"> Class template <code><phrase
@@ -2675,131 +3106,140 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.static_pool.constructor_unbounded_channel_hw">
- <title><link linkend="boost_task.reference.static_pool.constructor_unbounded_channel_hw">
- Constructor (unbounded channel)</link></title>
-<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">asleep</phrase> <phrase role="special">=</phrase> <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">microseconds</phrase><phrase role="special">(</phrase> <phrase role="number">10</phrase><phrase role="special">),</phrase>
- <phrase role="identifier">scanns</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">scns</phrase> <phrase role="special">=</phrase> <phrase role="identifier">scanns</phrase><phrase role="special">(</phrase> <phrase role="number">20</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase>
-</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- operating system provides functionality for processor pining
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a pool - for each processor a worker-thread is created and
- bound to one processor - global-queue can queue an unlimited number
- of tasks
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- constructor has to be called if a unbounded-channel is used
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.constructor_unbounded_channel">
- <title><link linkend="boost_task.reference.static_pool.constructor_unbounded_channel">
- Constructor (unbounded channel)</link></title>
+ <anchor id="boost_task.reference.static_pool.constructor__unbounded_channel_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.constructor__unbounded_channel_">Constructor
+ (unbounded channel)</link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">poolsize</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">psize</phrase><phrase role="special">,</phrase>
<phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">asleep</phrase> <phrase role="special">=</phrase> <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">microseconds</phrase><phrase role="special">(</phrase> <phrase role="number">10</phrase><phrase role="special">),</phrase>
<phrase role="identifier">scanns</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">scns</phrase> <phrase role="special">=</phrase> <phrase role="identifier">scanns</phrase><phrase role="special">(</phrase> <phrase role="number">20</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a pool containing psize worker-threads - global-queue can
- queue an unlimited number of tasks
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- constructor has to be called if a unbounded-channel is used
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.constructor_bounded_channel_hw">
- <title><link linkend="boost_task.reference.static_pool.constructor_bounded_channel_hw">
- Constructor (bounded channel)</link></title>
-<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ operating system provides functionality for processor pining
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a pool - for each processor a worker-thread is created and
+ bound to one processor - global-queue can queue an unlimited number of
+ tasks
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ constructor has to be called if a unbounded-channel is used
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.constructor__unbounded_channel_poolsize_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.constructor__unbounded_channel_poolsize_">Constructor
+ (unbounded channel/poolsize)</link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">poolsize</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">psize</phrase><phrase role="special">,</phrase>
+ <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">asleep</phrase> <phrase role="special">=</phrase> <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">microseconds</phrase><phrase role="special">(</phrase> <phrase role="number">10</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">scanns</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">scns</phrase> <phrase role="special">=</phrase> <phrase role="identifier">scanns</phrase><phrase role="special">(</phrase> <phrase role="number">20</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a pool containing psize worker-threads - global-queue can
+ queue an unlimited number of tasks
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ constructor has to be called if a unbounded-channel is used
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.constructor__bounded_channel_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.constructor__bounded_channel_">Constructor
+ (bounded channel)</link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
<phrase role="identifier">high_watermark</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">hwm</phrase><phrase role="special">,</phrase>
<phrase role="identifier">low_watermark</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">lwm</phrase><phrase role="special">,</phrase>
<phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">asleep</phrase> <phrase role="special">=</phrase> <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">milliseconds</phrase><phrase role="special">(</phrase> <phrase role="number">100</phrase><phrase role="special">),</phrase>
<phrase role="identifier">scanns</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">scns</phrase> <phrase role="special">=</phrase> <phrase role="identifier">scanns</phrase><phrase role="special">(</phrase> <phrase role="number">20</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- operating system provides functionality for processor pining
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a pool - for each processor a worker-thread is created and
- bound to one processor - global-queue can only queue a limited number
- of tasks
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>,
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_watermark</phrase></code>
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- Constructor has to be called if a bounded-channel is used.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.constructor_bounded_channel">
- <title><link linkend="boost_task.reference.static_pool.constructor_bounded_channel">
- Constructor (bounded channel)</link></title>
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ operating system provides functionality for processor pining
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a pool - for each processor a worker-thread is created and
+ bound to one processor - global-queue can only queue a limited number
+ of tasks
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>,
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_watermark</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ Constructor has to be called if a bounded-channel is used.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.constructor__bounded_channel_poolsize_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.constructor__bounded_channel_poolsize_">Constructor
+ (bounded channel/poolsize)</link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
<phrase role="identifier">poolsize</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">psize</phrase><phrase role="special">,</phrase>
<phrase role="identifier">high_watermark</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">hwm</phrase><phrase role="special">,</phrase>
@@ -2807,671 +3247,683 @@
<phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">asleep</phrase> <phrase role="special">=</phrase> <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">milliseconds</phrase><phrase role="special">(</phrase> <phrase role="number">100</phrase><phrase role="special">),</phrase>
<phrase role="identifier">scanns</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">scns</phrase> <phrase role="special">=</phrase> <phrase role="identifier">scanns</phrase><phrase role="special">(</phrase> <phrase role="number">20</phrase><phrase role="special">)</phrase> <phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a pool containing psize worker-threads - global-queue can
- only queue a limited number of tasks
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>,
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_watermark</phrase></code>
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- constructor has to be called if a bounded-channel is used
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.destructor">
- <title><link linkend="boost_task.reference.static_pool.destructor"> Destructor</link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a pool containing psize worker-threads - global-queue can
+ only queue a limited number of tasks
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>,
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_watermark</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ constructor has to be called if a bounded-channel is used
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.destructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.destructor">Destructor</link>
+ </bridgehead>
+
<programlisting><phrase role="special">~</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- calls <code><phrase role="special">:</phrase><phrase role="identifier">shutdown</phrase><phrase
- role="special">()</phrase></code> if not already called
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.size">
- <title><link linkend="boost_task.reference.static_pool.size"> Member function
- <code><phrase role="identifier">size</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ calls <code><phrase role="special">:</phrase><phrase role="identifier">shutdown</phrase><phrase
+ role="special">()</phrase></code> if not already called
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__size__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__size__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">size</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">size</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns how many worker-threads are running in the pool
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.active">
- <title><link linkend="boost_task.reference.static_pool.active"> Member function
- <code><phrase role="identifier">active</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns how many worker-threads are running in the pool
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__active__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__active__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">active</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">active</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns how many worker-threads are active (executing an task)
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.idle">
- <title><link linkend="boost_task.reference.static_pool.idle"> Member function
- <code><phrase role="identifier">idle</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns how many worker-threads are active (executing an task)
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__idle__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__idle__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">idle</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">idle</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns how many worker-threads are idle (not executing an task).
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- The value is the difference of <code><phrase role="identifier">size</phrase><phrase
- role="special">()</phrase></code> and <code><phrase role="identifier">active</phrase><phrase
- role="special">()</phrase></code>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.shutdown">
- <title><link linkend="boost_task.reference.static_pool.shutdown"> Member
- function <code><phrase role="identifier">shutdown</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns how many worker-threads are idle (not executing an task).
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ The value is the difference of <code><phrase role="identifier">size</phrase><phrase
+ role="special">()</phrase></code> and <code><phrase role="identifier">active</phrase><phrase
+ role="special">()</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">shutdown</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">shutdown</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- deactivates the channel and joins all worker-threads - the pool is
- closed
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- all pending tasks are processed
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.shutdown_now">
- <title><link linkend="boost_task.reference.static_pool.shutdown_now"> Member
- function <code><phrase role="identifier">shutdown_now</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ deactivates the channel and joins all worker-threads - the pool is closed
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ all pending tasks are processed
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown_now__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown_now__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">shutdown_now</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">shutdown_now</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- deactivates the channel, send interruption request to all worker-threads
- and joins them - the pool is closed
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- pending tasks are not processed but returned
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.losed">
- <title><link linkend="boost_task.reference.static_pool.losed"> Member function
- <code><phrase role="identifier">closed</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ deactivates the channel, send interruption request to all worker-threads
+ and joins them - the pool is closed
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ pending tasks are not processed but returned
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__closed__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__closed__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">closed</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">bool</phrase> <phrase role="identifier">closed</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- queries if the pool is closed (pool is shutdown)
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.clear">
- <title><link linkend="boost_task.reference.static_pool.clear"> Member function
- <code><phrase role="identifier">clear</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ queries if the pool is closed (pool is shutdown)
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__clear__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__clear__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">clear</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">clear</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- removes all pending tasks from the channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.empty">
- <title><link linkend="boost_task.reference.static_pool.empty"> Member function
- <code><phrase role="identifier">empty</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ removes all pending tasks from the channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__empty__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__empty__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">empty</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">bool</phrase> <phrase role="identifier">empty</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- queries if the channel is empty
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.pending">
- <title><link linkend="boost_task.reference.static_pool.pending"> Member function
- <code><phrase role="identifier">pending</phrase><phrase role="special">()</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ queries if the channel is empty
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__pending__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__pending__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">pending</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">pending</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- queries how many tasks are pending (still unprocessed) in the global-queue
- (channel)
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.get_upper_bound">
- <title><link linkend="boost_task.reference.static_pool.get_upper_bound">
- Member function <code><phrase role="identifier">upper_bound</phrase><phrase
- role="special">()</phrase></code></link></title>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ queries how many tasks are pending (still unprocessed) in the global-queue
+ (channel)
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__upper_bound__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__upper_bound__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">upper_bound</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">upper_bound</phrase><phrase role="special">()</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- channel is of type bounded-channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns the upper bound of the bounded-channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- can only be used if a bounded-channel is used
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.set_upper_bound">
- <title><link linkend="boost_task.reference.static_pool.set_upper_bound">
- Member function <code><phrase role="identifier">upper_bound</phrase><phrase
- role="special">(</phrase> <phrase role="identifier">high_watermark</phrase>
- <phrase role="keyword">const</phrase><phrase role="special">&</phrase>
- <phrase role="identifier">hwm</phrase><phrase role="special">)</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ channel is of type bounded-channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns the upper bound of the bounded-channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ can only be used if a bounded-channel is used
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__upper_bound__phrase__phrase_role__special_____phrase___phrase_role__identifier__high_watermark__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__hwm__phrase__phrase_role__special_____phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__upper_bound__phrase__phrase_role__special_____phrase___phrase_role__identifier__high_watermark__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__hwm__phrase__phrase_role__special_____phrase___code_">Member
+ function <code><phrase role="identifier">upper_bound</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">high_watermark</phrase> <phrase role="keyword">const</phrase><phrase
+ role="special">&</phrase> <phrase role="identifier">hwm</phrase><phrase
+ role="special">)</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">upper_bound</phrase><phrase role="special">(</phrase> <phrase role="identifier">high_watermark</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">hwm</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- channel is of type bounded-channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- sets the upper bound of the bounded-channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Postconditions:</term>
- <listitem>
- <para>
- <code><phrase role="keyword">this</phrase><phrase role="special">-></phrase><phrase
- role="identifier">upper_bound</phrase><phrase role="special">()</phrase>
- <phrase role="special">==</phrase> <phrase role="identifier">hwm</phrase></code>
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_watermark</phrase></code>
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- can only be used if a bounded-channel is used
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.get_lower_bound">
- <title><link linkend="boost_task.reference.static_pool.get_lower_bound">
- Member function <code><phrase role="identifier">lower_bound</phrase><phrase
- role="special">()</phrase></code></link></title>
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ channel is of type bounded-channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ sets the upper bound of the bounded-channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Postconditions:</term>
+ <listitem>
+ <para>
+ <code><phrase role="keyword">this</phrase><phrase role="special">-></phrase><phrase
+ role="identifier">upper_bound</phrase><phrase role="special">()</phrase>
+ <phrase role="special">==</phrase> <phrase role="identifier">hwm</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_watermark</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ can only be used if a bounded-channel is used
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__lower_bound__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__lower_bound__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">lower_bound</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">lower_bound</phrase><phrase role="special">();</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- channel is of type bounded-channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns the lower bound of the bounded-channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- can only be used if a bounded-channel is used
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.set_lower_bound">
- <title><link linkend="boost_task.reference.static_pool.set_lower_bound">
- Member function <code><phrase role="identifier">lower_bound</phrase><phrase
- role="special">(</phrase> <phrase role="identifier">low_watermark</phrase>
- <phrase role="keyword">const</phrase><phrase role="special">&</phrase>
- <phrase role="identifier">lwm</phrase><phrase role="special">)</phrase></code></link></title>
-
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ channel is of type bounded-channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns the lower bound of the bounded-channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ can only be used if a bounded-channel is used
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__lower_bound__phrase__phrase_role__special_____phrase___phrase_role__identifier__low_watermark__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__lwm__phrase__phrase_role__special_____phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__lower_bound__phrase__phrase_role__special_____phrase___phrase_role__identifier__low_watermark__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__lwm__phrase__phrase_role__special_____phrase___code_">Member
+ function <code><phrase role="identifier">lower_bound</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">low_watermark</phrase> <phrase role="keyword">const</phrase><phrase
+ role="special">&</phrase> <phrase role="identifier">lwm</phrase><phrase
+ role="special">)</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">lower_bound</phrase><phrase role="special">(</phrase> <phrase role="identifier">low_watermark</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">lwm</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- channel is of type bounded-channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- sets the lower bound of the bounded-channel
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Postconditions:</term>
- <listitem>
- <para>
- <code><phrase role="keyword">this</phrase><phrase role="special">-></phrase><phrase
- role="identifier">lower_bound</phrase><phrase role="special">()</phrase>
- <phrase role="special">==</phrase> <phrase role="identifier">lwm</phrase></code>
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_watermark</phrase></code>
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Notes:</term>
- <listitem>
- <para>
- can only be used if a bounded-channel is used
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.submit">
- <title><link linkend="boost_task.reference.static_pool.submit"> Member function
- <code><phrase role="identifier">submit</phrase><phrase role="special">(</phrase>
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ channel is of type bounded-channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ sets the lower bound of the bounded-channel
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Postconditions:</term>
+ <listitem>
+ <para>
+ <code><phrase role="keyword">this</phrase><phrase role="special">-></phrase><phrase
+ role="identifier">lower_bound</phrase><phrase role="special">()</phrase>
+ <phrase role="special">==</phrase> <phrase role="identifier">lwm</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_watermark</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Notes:</term>
+ <listitem>
+ <para>
+ can only be used if a bounded-channel is used
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__phrase__phrase_role__special_____phrase___phrase_role__identifier__act__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__act__phrase__phrase_role__special_____phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__phrase__phrase_role__special_____phrase___phrase_role__identifier__act__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__act__phrase__phrase_role__special_____phrase___code_">Member
+ function <code><phrase role="identifier">submit</phrase><phrase role="special">(</phrase>
<phrase role="identifier">Act</phrase> <phrase role="keyword">const</phrase><phrase
role="special">&</phrase> <phrase role="identifier">act</phrase><phrase
- role="special">)</phrase></code></link></title>
+ role="special">)</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase>
<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">submit</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">t</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- has_attribute< pool >::value == false && ! closed()
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- submits an task to the pool and returns an associated handle
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task_rejected</phrase></code>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.static_pool.submit_attr">
- <title><link linkend="boost_task.reference.static_pool.submit_attr"> Member
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ has_attribute< pool >::value == false && ! closed()
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ submits an task to the pool and returns an associated handle
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_rejected</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__phrase__phrase_role__special_____phrase___phrase_role__identifier__act__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__act__phrase__phrase_role__special_____phrase___phrase_role__identifier__attr__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__attr__phrase__phrase_role__special_____phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__phrase__phrase_role__special_____phrase___phrase_role__identifier__act__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__act__phrase__phrase_role__special_____phrase___phrase_role__identifier__attr__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__attr__phrase__phrase_role__special_____phrase___code_">Member
function <code><phrase role="identifier">submit</phrase><phrase role="special">(</phrase>
<phrase role="identifier">Act</phrase> <phrase role="keyword">const</phrase><phrase
role="special">&</phrase> <phrase role="identifier">act</phrase><phrase
role="special">,</phrase> <phrase role="identifier">Attr</phrase> <phrase
role="keyword">const</phrase><phrase role="special">&</phrase> <phrase
- role="identifier">attr</phrase><phrase role="special">)</phrase></code></link></title>
-
+ role="identifier">attr</phrase><phrase role="special">)</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Attr</phrase> <phrase role="special">></phrase>
<phrase role="identifier">handle</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="identifier">submit</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special"><</phrase> <phrase role="identifier">R</phrase> <phrase role="special">></phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">t</phrase><phrase role="special">,</phrase> <phrase role="identifier">Attr</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">attr</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- has_attribute< pool >::value == true && ! closed()
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- submits an task to the pool and returns an associated handle - task
- is scheduled by the attribute
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task_rejected</phrase></code>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ has_attribute< pool >::value == true && ! closed()
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ submits an task to the pool and returns an associated handle - task is
+ scheduled by the attribute
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_rejected</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
- <section id="boost_task.reference.utility">
- <title><link linkend="boost_task.reference.utility"> Utilities</link></title>
- <section id="boost_task.reference.utility.reschedule_until">
- <title><link linkend="boost_task.reference.utility.reschedule_until"> Non-member
- function <code><phrase role="identifier">reschedule_until</phrase><phrase
- role="special">()</phrase></code></link></title>
- <para>
-
+ <section id="boost_task.reference.reschedule_until">
+ <title><link linkend="boost_task.reference.reschedule_until"> Non-member function
+ <code><phrase role="identifier">reschedule_until</phrase><phrase role="special">()</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">utility</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Pred</phrase> <phrase role="special">></phrase>
<phrase role="keyword">void</phrase> <phrase role="identifier">reschedule_until</phrase><phrase role="special">(</phrase> <phrase role="identifier">Pred</phrase> <phrase role="keyword">const</phrase><phrase role="special">&)</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- reschedules current task until passed callable predicate becomes ready
- </para>
- </listitem>
- <listitem>
- <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Note:</term>
- <listitem>
- <para>
- This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.utility.get_pool">
- <title><link linkend="boost_task.reference.utility.get_pool"> Non-member
- function <code><phrase role="identifier">get_pool</phrase><phrase role="special">()</phrase></code></link></title>
- <para>
-
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ reschedules current task until passed callable predicate becomes ready
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ [Throws:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Nothing.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Note:</term>
+ <listitem>
+ <para>
+ This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.get_pool">
+ <title><link linkend="boost_task.reference.get_pool"> Non-member function
+ <code><phrase role="identifier">get_pool</phrase><phrase role="special">()</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">utility</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase> <phrase role="special">></phrase>
<phrase role="identifier">Pool</phrase> <phrase role="special">&</phrase> <phrase role="identifier">get_pool</phrase><phrase role="special">()</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns reference to the thread-pool where the current worker thread
- is executed
- </para>
- </listitem>
- <listitem>
- <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Note:</term>
- <listitem>
- <para>
- This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.utility.runs_in_pool">
- <title><link linkend="boost_task.reference.utility.runs_in_pool"> Non-member
- function <code><phrase role="identifier">runs_in_pool</phrase><phrase role="special">()</phrase></code></link></title>
- <para>
-
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns reference to the thread-pool where the current worker thread
+ is executed
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ [Throws:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Nothing.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Note:</term>
+ <listitem>
+ <para>
+ This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.runs_in_pool">
+ <title><link linkend="boost_task.reference.runs_in_pool"> Non-member function
+ <code><phrase role="identifier">runs_in_pool</phrase><phrase role="special">()</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">utility</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="keyword">bool</phrase> <phrase role="identifier">runs_in_pool</phrase><phrase role="special">()</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns true if the current task is executed in a thread-pool
- </para>
- </listitem>
- <listitem>
- <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Note:</term>
- <listitem>
- <para>
- This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.utility.worker_id">
- <title><link linkend="boost_task.reference.utility.worker_id"> Non-member
- function <code><phrase role="identifier">worker_id</phrase><phrase role="special">()</phrase></code></link></title>
- <para>
-
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns true if the current task is executed in a thread-pool
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ [Throws:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Nothing.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Note:</term>
+ <listitem>
+ <para>
+ This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.worker_id">
+ <title><link linkend="boost_task.reference.worker_id"> Non-member function
+ <code><phrase role="identifier">worker_id</phrase><phrase role="special">()</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">utility</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="identifier">id</phrase> <phrase role="identifier">worker_id</phrase><phrase role="special">()</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns returns the thread-id of the worker-thread
- </para>
- </listitem>
- <listitem>
- <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Note:</term>
- <listitem>
- <para>
- This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.utility.delay">
- <title><link linkend="boost_task.reference.utility.delay"> Non-member function
- <code><phrase role="identifier">delay</phrase><phrase role="special">()</phrase></code></link></title>
- <para>
-
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns returns the thread-id of the worker-thread
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ [Throws:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Nothing.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Note:</term>
+ <listitem>
+ <para>
+ This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.delay">
+ <title><link linkend="boost_task.reference.delay"> Non-member function <code><phrase
+ role="identifier">delay</phrase><phrase role="special">()</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">utility</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="keyword">void</phrase> <phrase role="identifier">delay</phrase><phrase role="special">(</phrase> <phrase role="identifier">system_time</phrase> <phrase role="identifier">abs_time</phrase><phrase role="special">)</phrase>
@@ -3479,110 +3931,109 @@
<phrase role="keyword">template</phrase><phrase role="special"><</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Duration</phrase> <phrase role="special">></phrase>
<phrase role="keyword">void</phrase> <phrase role="identifier">delay</phrase><phrase role="special">(</phrase> <phrase role="identifier">Duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">rel_time</phrase><phrase role="special">)</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- delays the execution of the current task so that the worker-thread
- can process another task in the meantime
- </para>
- </listitem>
- <listitem>
- <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Note:</term>
- <listitem>
- <para>
- This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.utility.yield">
- <title><link linkend="boost_task.reference.utility.yield"> Non-member function
- <code><phrase role="identifier">yield</phrase><phrase role="special">()</phrase></code></link></title>
- <para>
-
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ delays the execution of the current task so that the worker-thread can
+ process another task in the meantime
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ [Throws:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Nothing.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Note:</term>
+ <listitem>
+ <para>
+ This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.yield">
+ <title><link linkend="boost_task.reference.yield"> Non-member function <code><phrase
+ role="identifier">yield</phrase><phrase role="special">()</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">utility</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="keyword">void</phrase> <phrase role="identifier">yield</phrase><phrase role="special">()</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- yields the current task so that the worker-threadcan process another
- task in the meantime
- </para>
- </listitem>
- <listitem>
- <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Note:</term>
- <listitem>
- <para>
- This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.utility.interrupt">
- <title><link linkend="boost_task.reference.utility.interrupt"> Non-member
- function <code><phrase role="identifier">interrupt</phrase><phrase role="special">()</phrase></code></link></title>
- <para>
-
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ yields the current task so that the worker-threadcan process another
+ task in the meantime
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ [Throws:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Nothing.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Note:</term>
+ <listitem>
+ <para>
+ This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.interrupt">
+ <title><link linkend="boost_task.reference.interrupt"> Non-member function
+ <code><phrase role="identifier">interrupt</phrase><phrase role="special">()</phrase></code></link></title>
+ <para>
+
<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special"><</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">utility</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">></phrase>
<phrase role="keyword">void</phrase> <phrase role="identifier">interrupt</phrase><phrase role="special">()</phrase>
</programlisting>
- </para>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- task can request interruption for itself
- </para>
- </listitem>
- <listitem>
- <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Note:</term>
- <listitem>
- <para>
- This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ task can request interruption for itself
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ [Throws:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Nothing.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Note:</term>
+ <listitem>
+ <para>
+ This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.has_attribute">
<title><link linkend="boost_task.reference.has_attribute"> Meta function <code><phrase
@@ -3631,30 +4082,30 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.invalid_poolsize.constructor">
- <title><link linkend="boost_task.reference.invalid_poolsize.constructor">
- Constructor</link></title>
+ <anchor id="boost_task.reference.invalid_poolsize.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.invalid_poolsize.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">invalid_poolsize</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">msg</phrase><phrase role="special">);</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">invalid_poolsize</phrase></code>
- instance.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_poolsize</phrase></code> instance.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.invalid_scanns">
<title><link linkend="boost_task.reference.invalid_scanns"> Class <code><phrase
@@ -3670,30 +4121,29 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.invalid_scanns.constructor">
- <title><link linkend="boost_task.reference.invalid_scanns.constructor"> Constructor</link></title>
-
+ <para>
+ heading Constructor]
+ </para>
+
<programlisting><phrase role="identifier">invalid_scanns</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">msg</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">invalid_scanns</phrase></code>
- instance.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_scanns</phrase></code> instance.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.invalid_timeduration">
<title><link linkend="boost_task.reference.invalid_timeduration"> Class <code><phrase
@@ -3709,30 +4159,30 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.invalid_timeduration.constructor">
- <title><link linkend="boost_task.reference.invalid_timeduration.constructor">
- Constructor</link></title>
+ <anchor id="boost_task.reference.invalid_timeduration.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.invalid_timeduration.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">invalid_timeduration</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">msg</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">invalid_timeduration</phrase></code>
- instance.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_timeduration</phrase></code> instance.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.invalid_watermark">
<title><link linkend="boost_task.reference.invalid_watermark"> Class <code><phrase
@@ -3748,30 +4198,30 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.invalid_watermark.constructor">
- <title><link linkend="boost_task.reference.invalid_watermark.constructor">
- Constructor</link></title>
+ <anchor id="boost_task.reference.invalid_watermark.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.invalid_watermark.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">invalid_watermark</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">msg</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">invalid_watermark</phrase></code>
- instance.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_watermark</phrase></code> instance.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.task_rejected">
<title><link linkend="boost_task.reference.task_rejected"> Class <code><phrase
@@ -3787,30 +4237,30 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.task_rejected.constructor">
- <title><link linkend="boost_task.reference.task_rejected.constructor"> Constructor</link></title>
-
+ <anchor id="boost_task.reference.task_rejected.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task_rejected.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="identifier">task_rejected</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="keyword">const</phrase><phrase role="special">&</phrase> <phrase role="identifier">msg</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task_rejected</phrase></code>
- instance.
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_rejected</phrase></code> instance.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.poolsize">
<title><link linkend="boost_task.reference.poolsize"> Class <code><phrase role="identifier">poolsize</phrase></code></link></title>
@@ -3827,67 +4277,69 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.poolsize.constructor">
- <title><link linkend="boost_task.reference.poolsize.constructor"> Constructor</link></title>
-
+ <anchor id="boost_task.reference.poolsize.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.poolsize.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">poolsize</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">value</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- value > 0
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">poolsize</phrase></code>
- instance
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Postconditions:</term>
- <listitem>
- <para>
- operator std::size_t () > 0
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_poolsize</phrase></code>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.poolsize.operator">
- <title><link linkend="boost_task.reference.poolsize.operator"> Member function
- <code><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ value > 0
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">poolsize</phrase></code> instance
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Postconditions:</term>
+ <listitem>
+ <para>
+ operator std::size_t () > 0
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_poolsize</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.poolsize.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.poolsize.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase
role="special">::</phrase><phrase role="identifier">size_t</phrase><phrase
- role="special">()</phrase></code></link></title>
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns the value
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns the value
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.high_watermark">
<title><link linkend="boost_task.reference.high_watermark"> Class <code><phrase
@@ -3905,55 +4357,57 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.high_watermark.constructor">
- <title><link linkend="boost_task.reference.high_watermark.constructor"> Constructor</link></title>
-
+ <anchor id="boost_task.reference.high_watermark.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.high_watermark.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">high_watermark</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">value</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">tp</phrase><phrase
- role="special">::</phrase><phrase role="identifier">high_watermark</phrase></code>
- instance
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_watermark</phrase></code>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.high_watermark.operator">
- <title><link linkend="boost_task.reference.high_watermark.operator"> Member
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">tp</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">high_watermark</phrase></code> instance
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_watermark</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.high_watermark.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.high_watermark.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_">Member
function <code><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase
role="special">::</phrase><phrase role="identifier">size_t</phrase><phrase
- role="special">()</phrase></code></link></title>
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns high watermark
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns high watermark
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.low_watermark">
<title><link linkend="boost_task.reference.low_watermark"> Class <code><phrase
@@ -3971,55 +4425,57 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.low_watermark.constructor">
- <title><link linkend="boost_task.reference.low_watermark.constructor"> Constructor</link></title>
-
+ <anchor id="boost_task.reference.low_watermark.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.low_watermark.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">low_watermark</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">value</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">low_watermark</phrase></code>
- instance
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_watermark</phrase></code>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.low_watermark.operator">
- <title><link linkend="boost_task.reference.low_watermark.operator"> Member
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">low_watermark</phrase></code> instance
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_watermark</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.low_watermark.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.low_watermark.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_">Member
function <code><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase
role="special">::</phrase><phrase role="identifier">size_t</phrase><phrase
- role="special">()</phrase></code></link></title>
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns low watermark
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns low watermark
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<section id="boost_task.reference.scanns">
<title><link linkend="boost_task.reference.scanns"> Class <code><phrase role="identifier">scanns</phrase></code></link></title>
@@ -4036,67 +4492,69 @@
<phrase role="special">};</phrase>
</programlisting>
</para>
- <section id="boost_task.reference.scanns.constructor">
- <title><link linkend="boost_task.reference.scanns.constructor"> Constructor</link></title>
-
+ <anchor id="boost_task.reference.scanns.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.scanns.constructor">Constructor</link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">scanns</phrase><phrase role="special">(</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">value</phrase><phrase role="special">)</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- value > 0
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- constructs a <code><phrase role="identifier">boost</phrase><phrase
- role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">scanns</phrase></code>
- instance
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Postconditions:</term>
- <listitem>
- <para>
- operator std::size_t () > 0
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">invalid_poolsize</phrase></code>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section id="boost_task.reference.scanns.operator">
- <title><link linkend="boost_task.reference.scanns.operator"> Member function
- <code><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase
+ <variablelist>
+ <title></title> <varlistentry><term>Preconditions:</term>
+ <listitem>
+ <para>
+ value > 0
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">scanns</phrase></code> instance
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Postconditions:</term>
+ <listitem>
+ <para>
+ operator std::size_t () > 0
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">invalid_poolsize</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.scanns.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.scanns.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase
role="special">::</phrase><phrase role="identifier">size_t</phrase><phrase
- role="special">()</phrase></code></link></title>
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
<programlisting><phrase role="keyword">operator</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
</programlisting>
- <variablelist>
- <title></title> <varlistentry><term>Effects:</term>
- <listitem>
- <para>
- returns the value
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Throws:</term>
- <listitem>
- <para>
- Nothing
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns the value
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
</section>
<section id="boost_task.appendices">
@@ -4177,7 +4635,7 @@
</bridgehead>
<itemizedlist>
<listitem>
- <emphasis>asynchronous-executors</emphasis> related to a <emphasis>thread-pool</emphasis>
+ <emphasis>execution-policies</emphasis> related to a <emphasis>thread-pool</emphasis>
(like <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
role="identifier">task</phrase><phrase role="special">::</phrase><phrase
role="identifier">default_pool</phrase></code>) could support explicit
@@ -4217,8 +4675,9 @@
<title><link linkend="boost_task.appendices.acknowledgements"> Appendix B:
Acknowledgments</link></title>
<para>
- I'd like to thank Vicente J. Botet Escriba for his comments on the implementation
- and Anthony Williams and Braddock Gaskill for their future libraries.
+ I'd like to thank Vicente J. Botet Escriba for his contributions (default_pool,
+ reschedule_until, sleep, yield) and Anthony Williams and Braddock Gaskill
+ for their future libraries.
</para>
</section>
</section>
Modified: sandbox/task/libs/task/doc/default_pool.qbk
==============================================================================
--- sandbox/task/libs/task/doc/default_pool.qbk (original)
+++ sandbox/task/libs/task/doc/default_pool.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -34,13 +34,13 @@
boost::task::handle< long > h1(
boost::task::async(
- boost::task::default_pool(), // asynchronous executor == default-pool
- boost::task::make_task( fibonacci_fn, 10) ) );
+ boost::task::make_task( fibonacci_fn, 10),
+ boost::task::default_pool() ) ); // execution-policy == default-pool
boost::task::handle< long > h2(
boost::task::async(
- boost::task::default_pool(), // asynchronous executor == default-pool
- boost::task::make_task( fibonacci_fn, 5) ) );
+ boost::task::make_task( fibonacci_fn, 5),
+ boost::task::default_pool() ) ); // execution-policy == default-pool
std::cout << "fibonacci(10) == " << h1.get() << "\n";
std::cout << "fibonacci(5) == " << h2.get() << std::endl;
Added: sandbox/task/libs/task/doc/execution_policy.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/execution_policy.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -0,0 +1,22 @@
+[/
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+
+[section:execution_policy Execution policy]
+
+In contrast to synchronous methods asynchronous methods do not block the program flow when a time consuming operation is executed.
+The application continues executing the current context and when the result of the asynchronous method is required the __act__ can be used.
+
+A __ep__ describes how a __task__ gets asynchronously executed and provides a link_handle(__act__) to manage the __task__.
+
+[include own_thread.qbk]
+[include new_thread.qbk]
+[include pool.qbk]
+[include as_sub_task.qbk]
+
+
+[endsect]
Modified: sandbox/task/libs/task/doc/fork_join.qbk
==============================================================================
--- sandbox/task/libs/task/doc/fork_join.qbk (original)
+++ sandbox/task/libs/task/doc/fork_join.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -28,18 +28,20 @@
{
// fork a sub-task calculating fibonacci(n-1)
h1 = boost::task::async(
- boost::task::as_sub_task(),
boost::task::make_task(
parallel_fib,
n - 1,
- cutof) );
+ cutof),
+ boost::task::as_sub_task() );
+
// fork a sub-task calculating fibonacci(n-2)
h2 = boost::task::async(
- boost::task::as_sub_task(),
boost::task::make_task(
parallel_fib,
n - 2,
- cutof) );
+ cutof),
+ boost::task::as_sub_task() );
+
// join the results of both sub-tasks
// if one of the both sub-tasks is not ready
// the worker-thread does not block, it executes other
@@ -50,13 +52,13 @@
void main()
{
- boost::task::handle< long > h( // handle for fibonacci calculation
+ boost::task::handle< long > h( // handle for fibonacci calculation
boost::task::async(
- boost::task::default_pool(), // access the default thread-pool
- boost::task::make_task( // calculate fibonacci number 10
- parallel_fib, // for numbers < 5 do inline recursive calculation
+ boost::task::make_task( // calculate fibonacci number 10
+ parallel_fib, // for numbers < 5 do inline recursive calculation
10,
- 5) ) );
+ 5),
+ boost::task::default_pool() ) ); // access the default thread-pool
std::cout << h.get() << std::endl;
}
``
Modified: sandbox/task/libs/task/doc/handle.qbk
==============================================================================
--- sandbox/task/libs/task/doc/handle.qbk (original)
+++ sandbox/task/libs/task/doc/handle.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -12,14 +12,14 @@
the task and state necessary to process the result of the operation [footnote see [@http://www.cs.wustl.edu/~schmidt/PDF/ACT.pdf
'Asynchronous Completion Token'], Douglas Schmidt].
-__handle__ represents an __act__. It will be returned by __fn_async__ and is associated with the submitted __task__.
+__handle__ represents an __act__. It will be returned by [link_async __fn_async__] and is associated with the submitted __task__.
[heading Asynchronous completion token interface]
-__handle__ implements an interface in order to check the state of computation and result transfer
+__handle__ implements an interface in order to check the state of computation and to transfer the result.
-* __fn_get_id__: return id of the associated task-id
+* __fn_get_id__: return id of the associated __task_id__
* __fn_is_ready__: test if result is set
@@ -27,7 +27,7 @@
* __fn_has_exception__: test if exception-result is set
-* __fn_get__: return value-result
+* __fn_get__: return value-result or throw the exception-result
* __fn_wait__: wait until result is set
@@ -38,23 +38,15 @@
``
long fibonacci( long n)
{
- boost::this_thread::interruption_point(); // interruption point
-
if ( n == 0) return 0;
if ( n == 1) return 1;
long k1( 1), k2( 0);
for ( int i( 2); i <= n; ++i)
{
- if ( boost::this_thread::interruption_requested() ) // check if interruption was requested
- return;
-
long tmp( k1);
k1 = k1 + k2;
k2 = tmp;
}
-
- boost::this_thread::interruption_point(); // interruption point
-
return k1;
}
@@ -62,10 +54,10 @@
{
boost::task::handle< long > h(
boost::task::async(
- boost::task::new_thread(),
boost::task::make_task(
fibonacci,
- 10) ) );
+ 10),
+ boost::task::new_thread() ) );
std::cout << "id == " << h.get_id() << "\n";
std::cout << "is ready == " << std::boolalpha << h.is_ready() << "\n";
h.wait();
@@ -75,15 +67,20 @@
}
``
+
[heading Task interruption]
+Each invokation of __fn_async__ returns an __handle__ which allows to control the associated __task__ (passed to __fn_async__). This includes
+the ability to interrupt an __task__ if it is cooperative. Cooperative means that the __task__ contains __interruption_points__ or checks for
+interruption requests [footnote see [@http://www.ddj.com/architect/207100682 'Interrupt Politely'], Herb Sutter].
+
* __fn_interrupt__: interrupt __task__ and return immediately
* __fn_interrupt_and_wait__: interrupt and wait until __task__ was removed from __worker_thread__
* __fn_interrupt_and_wait_for__: interrupt and wait until __task__ was removed from __worker_thread__ or time duration has elapsed
-* __fn_interrupt_and_wait_until__: interrupt and wait until __task__ was removed from __worker_thread__ or time point has elapsed
+* __fn_interrupt_and_wait_until__: interrupt and wait until __task__ was removed from __worker_thread__ or time point has reached
* __fn_interruption_requested__: return bool if interruption was requested
@@ -91,7 +88,7 @@
long cooperative( long n)
{
boost::this_thread::interruption_point(); // interruption point
-
+
if ( n == 0) return 0;
if ( n == 1) return 1;
long k1( 1), k2( 0);
@@ -99,25 +96,25 @@
{
if ( boost::this_thread::interruption_requested() ) // check if interruption was requested
return;
-
+
long tmp( k1);
k1 = k1 + k2;
k2 = tmp;
}
-
+
boost::this_thread::interruption_point(); // interruption point
-
+
return k1;
}
void main()
{
boost::task::handle< long > h( // get handle associated with the task
- boost::task::async(
- boost::task::new_thread(), // asynchronous executor
+ boost::task::async(
boost::task::make_task( // task, to be executed asynchronously
cooperative,
- 10) ) );
+ 10),
+ boost::task::new_thread() ) ); // asynchronous executor
h.interrupt_and_wait();
std::cout << "id == " << h.get_id() << "\n";
std::cout << "is ready == " << std::boolalpha << h.is_ready() << "\n";
@@ -127,4 +124,76 @@
}
``
+[note If the task is still pending when an interruption is requested - the task is not removed from the queue, it is marked to be interrupted instead.]
+
+
+[heading Waiting for handles]
+
+__boost_task__ provides function __waitfor_all__ waits for all handles passed to this function to become ready
+
+
+``
+ void main()
+ {
+ std::vector handles< boost::task::handle< long > > results;
+ results.reserve( 10);
+
+ for ( int i = 0; i < 10; ++i)
+ results.push_back(
+ boost::task::async(
+ boost::task::make_task(
+ fibonacci,
+ 10) ) ) );
+
+ // wait until all tasks are ready
+ boost::task::waitfor_all( results.begin(), results.end() );
+
+ int k = 0;
+ std::vector< boost::task::handle< long > >::iterator e( results.end() );
+ for (
+ std::vector< boost::task::handle< long > >::iterator i( results.begin() );
+ i != e;
+ ++i)
+ std::cout << "fibonacci(" << k++ << ") == " << i->get() << std::endl;
+ }
+``
+
+
+and __waitfor_any__ which returns if at least one of the passed handles becomes ready.
+
+
+``
+ void main()
+ {
+ boost::task::handle< long > h1(
+ boost::task::async(
+ boost::task::make_task(
+ cooperative,
+ 10) ) );
+
+ boost::task::handle< long > h2(
+ boost::task::async(
+ boost::task::make_task(
+ cooperative,
+ 7) ) );
+
+ boost::task::handle< long > h3(
+ boost::task::async(
+ boost::task::make_task(
+ cooperative,
+ 5) ) );
+
+ // wait for any task becomes ready
+ boost::task::waitfor_any( h1, h2, h3);
+
+ if ( h1.is_ready() )
+ std::cout << "fibonacci(10) == " << h1.get() << std::endl;
+ if ( h2.is_ready() )
+ std::cout << "fibonacci(7) == " << h2.get() << std::endl;
+ if ( h3.is_ready() )
+ std::cout << "fibonacci(5) == " << h3.get() << std::endl;
+ }
+``
+
+
[endsect]
Modified: sandbox/task/libs/task/doc/html/boost_task/appendices.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/appendices.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/appendices.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -35,7 +35,7 @@
<a name="boost_task.appendices.todo"></a><a class="link" href="appendices.html#boost_task.appendices.todo" title="Appendix A: Future development"> Appendix A: Future development</a>
</h3></div></div></div>
<a name="boost_task.appendices.todo.dynamic_thread_pool"></a><h5>
-<a name="id598832"></a>
+<a name="id627171"></a>
<a class="link" href="appendices.html#boost_task.appendices.todo.dynamic_thread_pool">Dynamic thread-pool</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
@@ -44,7 +44,7 @@
oversubscription).
</li></ul></div>
<a name="boost_task.appendices.todo.communication_and_synchronisation_abstractions"></a><h5>
-<a name="id598896"></a>
+<a name="id627235"></a>
<a class="link" href="appendices.html#boost_task.appendices.todo.communication_and_synchronisation_abstractions">Communication
and synchronisation abstractions</a>
</h5>
@@ -87,7 +87,7 @@
</li>
</ul></div>
<a name="boost_task.appendices.todo.interdepended_task"></a><h5>
-<a name="id598986"></a>
+<a name="id627326"></a>
<a class="link" href="appendices.html#boost_task.appendices.todo.interdepended_task">Interdepended
task</a>
</h5>
@@ -96,17 +96,17 @@
tasks work in <span class="emphasis"><em>thread-pools</em></span> (using context switching/fibers).
</li></ul></div>
<a name="boost_task.appendices.todo.support_of_explicit_processor_bindig"></a><h5>
-<a name="id599017"></a>
+<a name="id627357"></a>
<a class="link" href="appendices.html#boost_task.appendices.todo.support_of_explicit_processor_bindig">Support
of explicit processor bindig</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
-<span class="emphasis"><em>asynchronous-executors</em></span> related to a <span class="emphasis"><em>thread-pool</em></span>
+<span class="emphasis"><em>execution-policies</em></span> related to a <span class="emphasis"><em>thread-pool</em></span>
(like <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span></code>) could support explicit
processor binding.
</li></ul></div>
<a name="boost_task.appendices.todo.optimizations"></a><h5>
-<a name="id599080"></a>
+<a name="id627420"></a>
<a class="link" href="appendices.html#boost_task.appendices.todo.optimizations">Optimizations</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -119,7 +119,7 @@
</li>
</ul></div>
<a name="boost_task.appendices.todo.actor_framework"></a><h5>
-<a name="id599114"></a>
+<a name="id627454"></a>
<a class="link" href="appendices.html#boost_task.appendices.todo.actor_framework">Actor framework</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -140,8 +140,9 @@
Acknowledgments</a>
</h3></div></div></div>
<p>
- I'd like to thank Vicente J. Botet Escriba for his comments on the implementation
- and Anthony Williams and Braddock Gaskill for their future libraries.
+ I'd like to thank Vicente J. Botet Escriba for his contributions (default_pool,
+ reschedule_until, sleep, yield) and Anthony Williams and Braddock Gaskill
+ for their future libraries.
</p>
</div>
</div>
Modified: sandbox/task/libs/task/doc/html/boost_task/as_sub_task.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/as_sub_task.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/as_sub_task.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -32,35 +32,18 @@
task is executed inside a <span class="emphasis"><em>thread-pool</em></span> the <span class="emphasis"><em>sub-task</em></span>
is put into the local-queue of the <span class="emphasis"><em>worker-thread</em></span> in the
other case the <span class="emphasis"><em>sub-task</em></span> will be executed in a new thread.
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span></code>
+ is used as default <span class="emphasis"><em>execution-policy</em></span> for <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">()</span></code>,
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">fibonacci</span><span class="special">,</span>
- <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-</pre>
-<p>
- </p>
-<p>
- is equivalent to:
- </p>
-<p>
-
-</p>
-<pre class="programlisting"><span class="keyword">if</span> <span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span><span class="special">::</span><span class="identifier">runs_in_pool</span><span class="special">()</span> <span class="special">)</span>
-<span class="special">{</span>
- <span class="comment">// put the sub-task into worker-threads local-queue
-</span><span class="special">}</span>
-<span class="keyword">else</span>
-<span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(...)</span> <span class="special">);</span>
-<span class="special">}</span>
+ <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span>
</pre>
<p>
</p>
Added: sandbox/task/libs/task/doc/html/boost_task/async.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/async.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -0,0 +1,89 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Asynchronous execution</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.0">
+<link rel="home" href="../index.html" title="Chapter 1. Boost.Task">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Task">
+<link rel="prev" href="handle.html" title="Handle">
+<link rel="next" href="own_thread.html" title="Execute in own thread">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>
+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
+<td align="center">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="handle.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="own_thread.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Asynchronous execution">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.async"></a><a class="link" href="async.html" title="Asynchronous execution"> Asynchronous execution</a>
+</h2></div></div></div>
+<p>
+ The function <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">()</span></code> passes the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code> to the <span class="emphasis"><em>execution-policy</em></span>
+ which executes the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>
+ (for this purpose <span class="emphasis"><em>execution-policy</em></span> is required to provide
+ <code class="computeroutput"><span class="identifier">handle</span><span class="special"><</span>
+ <span class="identifier">R</span> <span class="special">></span>
+ <span class="keyword">operator</span><span class="special">()(</span>
+ <span class="identifier">task</span><span class="special"><</span>
+ <span class="identifier">R</span> <span class="special">></span>
+ <span class="identifier">tsk</span><span class="special">)</span></code>).
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">()</span></code> accepts two arguments - the first is an
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>
+ object and the second an <span class="emphasis"><em>execution-policy</em></span>. For the second
+ argument <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span></code>
+ is used per default. The function returns a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span></code> which controls the submitted <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">fibonacci</span><span class="special">(</span> <span class="keyword">long</span> <span class="identifier">n</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">n</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">n</span> <span class="special">==</span> <span class="number">1</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
+ <span class="keyword">long</span> <span class="identifier">k1</span><span class="special">(</span> <span class="number">1</span><span class="special">),</span> <span class="identifier">k2</span><span class="special">(</span> <span class="number">0</span><span class="special">);</span>
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">(</span> <span class="number">2</span><span class="special">);</span> <span class="identifier">i</span> <span class="special"><=</span> <span class="identifier">n</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">long</span> <span class="identifier">tmp</span><span class="special">(</span> <span class="identifier">k1</span><span class="special">);</span>
+ <span class="identifier">k1</span> <span class="special">=</span> <span class="identifier">k1</span> <span class="special">+</span> <span class="identifier">k2</span><span class="special">;</span>
+ <span class="identifier">k2</span> <span class="special">=</span> <span class="identifier">tmp</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="identifier">k1</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// get handle associated with the task
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// compute fibonacci(10) asynchron
+</span> <span class="identifier">fibonacci</span><span class="special">,</span>
+ <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"id == "</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get_id</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(10) == "</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// throws boost::task::task_interrupted
+</span><span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Oliver Kowalke<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="handle.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="own_thread.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/task/libs/task/doc/html/boost_task/handle.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/handle.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/handle.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -7,7 +7,7 @@
<link rel="home" href="../index.html" title="Chapter 1. Boost.Task">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Task">
<link rel="prev" href="task.html" title="Task">
-<link rel="next" href="own_thread.html" title="Execute in own thread">
+<link rel="next" href="async.html" title="Asynchronous execution">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="task.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="own_thread.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="task.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="async.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Handle">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -31,29 +31,30 @@
response to the completion of asynchronous operations. <span class="emphasis"><em>asynchronous-completion-token</em></span>
uniquely identifies the task and state necessary to process the result of the
operation
- <sup>[<a name="id569908" href="#ftn.id569908" class="footnote">3</a>]</sup>
+ <sup>[<a name="id590338" href="#ftn.id590338" class="footnote">3</a>]</sup>
.
</p>
<p>
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span></code>
represents an <span class="emphasis"><em>asynchronous-completion-token</em></span>. It will be
- returned by <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">()</span></code> and is associated with the submitted <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>.
+ returned by <a class="link" href="async.html" title="Asynchronous execution"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">()</span></code></a>
+ and is associated with the submitted <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>.
</p>
<a name="boost_task.handle.asynchronous_completion_token_interface"></a><h4>
-<a name="id570012"></a>
+<a name="id590444"></a>
<a class="link" href="handle.html#boost_task.handle.asynchronous_completion_token_interface">Asynchronous
completion token interface</a>
</h4>
<p>
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span></code>
- implements an interface in order to check the state of computation and result
- transfer
+ implements an interface in order to check the state of computation and to transfer
+ the result.
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<code class="computeroutput"><span class="identifier">get_id</span><span class="special">()</span></code>:
- return id of the associated task-id
- </li>
+ return id of the associated <span class="emphasis"><em>task-id</em></span>
+</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">is_ready</span><span class="special">()</span></code>:
test if result is set
@@ -68,7 +69,7 @@
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code>:
- return value-result
+ return value-result or throw the exception-result
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">wait</span><span class="special">()</span></code>:
@@ -88,23 +89,15 @@
</p>
<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">fibonacci</span><span class="special">(</span> <span class="keyword">long</span> <span class="identifier">n</span><span class="special">)</span>
<span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_point</span><span class="special">();</span> <span class="comment">// interruption point
-</span>
<span class="keyword">if</span> <span class="special">(</span> <span class="identifier">n</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="keyword">if</span> <span class="special">(</span> <span class="identifier">n</span> <span class="special">==</span> <span class="number">1</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
<span class="keyword">long</span> <span class="identifier">k1</span><span class="special">(</span> <span class="number">1</span><span class="special">),</span> <span class="identifier">k2</span><span class="special">(</span> <span class="number">0</span><span class="special">);</span>
<span class="keyword">for</span> <span class="special">(</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">(</span> <span class="number">2</span><span class="special">);</span> <span class="identifier">i</span> <span class="special"><=</span> <span class="identifier">n</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
<span class="special">{</span>
- <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_requested</span><span class="special">()</span> <span class="special">)</span> <span class="comment">// check if interruption was requested
-</span> <span class="keyword">return</span><span class="special">;</span>
-
<span class="keyword">long</span> <span class="identifier">tmp</span><span class="special">(</span> <span class="identifier">k1</span><span class="special">);</span>
<span class="identifier">k1</span> <span class="special">=</span> <span class="identifier">k1</span> <span class="special">+</span> <span class="identifier">k2</span><span class="special">;</span>
<span class="identifier">k2</span> <span class="special">=</span> <span class="identifier">tmp</span><span class="special">;</span>
<span class="special">}</span>
-
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_point</span><span class="special">();</span> <span class="comment">// interruption point
-</span>
<span class="keyword">return</span> <span class="identifier">k1</span><span class="special">;</span>
<span class="special">}</span>
@@ -112,10 +105,10 @@
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">fibonacci</span><span class="special">,</span>
- <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"id == "</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get_id</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"is ready == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
<span class="identifier">h</span><span class="special">.</span><span class="identifier">wait</span><span class="special">();</span>
@@ -127,9 +120,19 @@
<p>
</p>
<a name="boost_task.handle.task_interruption"></a><h4>
-<a name="id571214"></a>
+<a name="id591532"></a>
<a class="link" href="handle.html#boost_task.handle.task_interruption">Task interruption</a>
</h4>
+<p>
+ Each invokation of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">()</span></code> returns an <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span></code> which allows to control the associated
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>
+ (passed to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">()</span></code>). This includes the ability to interrupt
+ an <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>
+ if it is cooperative. Cooperative means that the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code> contains <span class="emphasis"><em>interruption-points</em></span>
+ or checks for interruption requests
+ <sup>[<a name="id591705" href="#ftn.id591705" class="footnote">4</a>]</sup>
+ .
+ </p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code>:
@@ -148,7 +151,7 @@
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">interrupt_and_wait_until</span><span class="special">()</span></code>: interrupt and wait until <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code> was removed from <span class="emphasis"><em>worker-thread</em></span>
- or time point has elapsed
+ or time point has reached
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_requested</span><span class="special">()</span></code>:
@@ -161,7 +164,7 @@
<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">cooperative</span><span class="special">(</span> <span class="keyword">long</span> <span class="identifier">n</span><span class="special">)</span>
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_point</span><span class="special">();</span> <span class="comment">// interruption point
-</span>
+</span>
<span class="keyword">if</span> <span class="special">(</span> <span class="identifier">n</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="keyword">if</span> <span class="special">(</span> <span class="identifier">n</span> <span class="special">==</span> <span class="number">1</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
<span class="keyword">long</span> <span class="identifier">k1</span><span class="special">(</span> <span class="number">1</span><span class="special">),</span> <span class="identifier">k2</span><span class="special">(</span> <span class="number">0</span><span class="special">);</span>
@@ -169,26 +172,26 @@
<span class="special">{</span>
<span class="keyword">if</span> <span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_requested</span><span class="special">()</span> <span class="special">)</span> <span class="comment">// check if interruption was requested
</span> <span class="keyword">return</span><span class="special">;</span>
-
+
<span class="keyword">long</span> <span class="identifier">tmp</span><span class="special">(</span> <span class="identifier">k1</span><span class="special">);</span>
<span class="identifier">k1</span> <span class="special">=</span> <span class="identifier">k1</span> <span class="special">+</span> <span class="identifier">k2</span><span class="special">;</span>
<span class="identifier">k2</span> <span class="special">=</span> <span class="identifier">tmp</span><span class="special">;</span>
<span class="special">}</span>
-
+
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_point</span><span class="special">();</span> <span class="comment">// interruption point
-</span>
+</span>
<span class="keyword">return</span> <span class="identifier">k1</span><span class="special">;</span>
<span class="special">}</span>
<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// get handle associated with the task
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
</span> <span class="identifier">cooperative</span><span class="special">,</span>
- <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
- <span class="identifier">h</span><span class="special">.</span><span class="identifier">interrupt_and_wait</span><span class="special">();</span>
+ <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// asynchronous executor
+</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">interrupt_and_wait</span><span class="special">();</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"id == "</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get_id</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"is ready == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"has value == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">has_value</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
@@ -198,12 +201,103 @@
</pre>
<p>
</p>
+<div class="note" title="Note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ If the task is still pending when an interruption is requested - the task
+ is not removed from the queue, it is marked to be interrupted instead.
+ </p></td></tr>
+</table></div>
+<a name="boost_task.handle.waiting_for_handles"></a><h4>
+<a name="id592975"></a>
+ <a class="link" href="handle.html#boost_task.handle.waiting_for_handles">Waiting for handles</a>
+ </h4>
+<p>
+ <span class="bold"><strong>Boost.Task</strong></span> provides function <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">waitfor_all</span><span class="special">()</span></code> waits for all handles passed to this function
+ to become ready
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span> <span class="identifier">handles</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="special">></span> <span class="identifier">results</span><span class="special">;</span>
+ <span class="identifier">results</span><span class="special">.</span><span class="identifier">reserve</span><span class="special">(</span> <span class="number">10</span><span class="special">);</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="number">10</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
+ <span class="identifier">results</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
+ <span class="identifier">fibonacci</span><span class="special">,</span>
+ <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+
+ <span class="comment">// wait until all tasks are ready
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">results</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">results</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">);</span>
+
+ <span class="keyword">int</span> <span class="identifier">k</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">e</span><span class="special">(</span> <span class="identifier">results</span><span class="special">.</span><span class="identifier">end</span><span class="special">()</span> <span class="special">);</span>
+ <span class="keyword">for</span> <span class="special">(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="special">>::</span><span class="identifier">iterator</span> <span class="identifier">i</span><span class="special">(</span> <span class="identifier">results</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()</span> <span class="special">);</span>
+ <span class="identifier">i</span> <span class="special">!=</span> <span class="identifier">e</span><span class="special">;</span>
+ <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci("</span> <span class="special"><<</span> <span class="identifier">k</span><span class="special">++</span> <span class="special"><<</span> <span class="string">") == "</span> <span class="special"><<</span> <span class="identifier">i</span><span class="special">-></span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">waitfor_any</span><span class="special">()</span></code> which returns if at least one of the passed
+ handles becomes ready.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h1</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
+ <span class="identifier">cooperative</span><span class="special">,</span>
+ <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h2</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
+ <span class="identifier">cooperative</span><span class="special">,</span>
+ <span class="number">7</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h3</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
+ <span class="identifier">cooperative</span><span class="special">,</span>
+ <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+
+ <span class="comment">// wait for any task becomes ready
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">h1</span><span class="special">,</span> <span class="identifier">h2</span><span class="special">,</span> <span class="identifier">h3</span><span class="special">);</span>
+
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(10) == "</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(7) == "</span> <span class="special"><<</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">h3</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(5) == "</span> <span class="special"><<</span> <span class="identifier">h3</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a name="ftn.id569908" href="#id569908" class="para">3</a>] </sup>
+<div class="footnote"><p><sup>[<a name="ftn.id590338" href="#id590338" class="para">3</a>] </sup>
see <a href="http://www.cs.wustl.edu/~schmidt/PDF/ACT.pdf" target="_top">'Asynchronous
Completion Token'</a>, Douglas Schmidt
</p></div>
+<div class="footnote"><p><sup>[<a name="ftn.id591705" href="#id591705" class="para">4</a>] </sup>
+ see 'Interrupt Politely',
+ Herb Sutter
+ </p></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
@@ -216,7 +310,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="task.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="own_thread.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="task.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="async.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/task/libs/task/doc/html/boost_task/motivation.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/motivation.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/motivation.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -30,7 +30,7 @@
To speed-up computer-bound work and/or increase the computation-throughput
is a common motivation for parallelizing a program. Especially for interactive
applications that have to process user input while performing some background
- tasks responsivness iss very important. Parallelizing a program requires partitioning
+ tasks responsivness is very important. Parallelizing a program requires partitioning
the program into smaller chunks that can run in parallel. The code can scale
as the hardware gets better without changing the code.
</p>
@@ -46,13 +46,13 @@
<tr><td align="left" valign="top"><p>
<span class="quote">“<span class="quote">You can have multithreading on a single core machine, but you can
only have parallelism on a multi core machine ... .</span>”</span> -- Daniel Moth
- <sup>[<a name="id563974" href="#ftn.id563974" class="footnote">1</a>]</sup>
+ <sup>[<a name="id584468" href="#ftn.id584468" class="footnote">1</a>]</sup>
</p></td></tr>
</table></div>
<p>
<span class="bold"><strong>Boost.Task</strong></span> provides a framework to utilize
the available hardware and provide a way for efficient asynchronous processing
- of time consuming operations. The framework provides some <span class="emphasis"><em>asynchronous-executors</em></span>,
+ of time consuming operations. The framework provides some <span class="emphasis"><em>execution-policies</em></span>,
like <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span></code>,
in order to execute the task asynchronously in another execution context (<span class="bold"><strong>Boost.Task</strong></span> uses preemptible threads for this purpose).
</p>
@@ -65,11 +65,11 @@
<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span> <span class="comment">// dispatchs task
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span> <span class="comment">// asynchronous executor
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
</span> <span class="identifier">print</span><span class="special">,</span>
- <span class="string">"Hello World!"</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-<span class="special">}</span>
+ <span class="string">"Hello World!"</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span><span class="special">}</span>
</pre>
<p>
</p>
@@ -89,11 +89,11 @@
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// get handle associated with the task
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
</span> <span class="identifier">echo</span><span class="special">,</span>
- <span class="string">"Hello World!"</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// wait until task is finished and return the result
+ <span class="string">"Hello World!"</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// wait until task is finished and return the result
</span><span class="special">}</span>
</pre>
<p>
@@ -111,12 +111,12 @@
<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// get handle associated with the task
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// long runing task, to be executed asynchronously
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// long runing task, to be executed asynchronously
</span> <span class="identifier">long_running</span><span class="special">,</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">millisec</span><span class="special">(</span> <span class="number">500</span><span class="special">)</span> <span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
- <span class="identifier">h</span><span class="special">.</span><span class="identifier">interrupt</span><span class="special">();</span> <span class="comment">// interrupt execution of task
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">millisec</span><span class="special">(</span> <span class="number">500</span><span class="special">)</span> <span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">interrupt</span><span class="special">();</span> <span class="comment">// interrupt execution of task
</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// wait until task is finished, will throw an exeception
</span><span class="special">}</span>
</pre>
@@ -148,18 +148,20 @@
<span class="special">{</span>
<span class="comment">// fork a sub-task calculating fibonacci(n-1)
</span> <span class="identifier">h1</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span><span class="special">::</span><span class="identifier">get_pool</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">parallel_fib</span><span class="special">,</span>
<span class="identifier">n</span> <span class="special">-</span> <span class="number">1</span><span class="special">,</span>
- <span class="identifier">cutof</span><span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">cutof</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span><span class="special">::</span><span class="identifier">get_pool</span><span class="special">()</span> <span class="special">);</span>
+
<span class="comment">// fork a sub-task calculating fibonacci(n-2)
</span> <span class="identifier">h2</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span><span class="special">::</span><span class="identifier">get_pool</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">parallel_fib</span><span class="special">,</span>
<span class="identifier">n</span> <span class="special">-</span> <span class="number">2</span><span class="special">,</span>
- <span class="identifier">cutof</span><span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">cutof</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span><span class="special">::</span><span class="identifier">get_pool</span><span class="special">()</span> <span class="special">);</span>
+
<span class="comment">// join the results of both sub-tasks
</span> <span class="keyword">return</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">();</span>
<span class="special">}</span>
@@ -167,14 +169,14 @@
<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// handle for fibonacci calculation
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// handle for fibonacci calculation
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">(),</span> <span class="comment">// access the default thread-pool
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// calculate fibonacci number 10
-</span> <span class="identifier">parallel_fib</span><span class="special">,</span> <span class="comment">// for numbers < 5 do inline recursive calculation
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// calculate fibonacci number 10
+</span> <span class="identifier">parallel_fib</span><span class="special">,</span> <span class="comment">// for numbers < 5 do inline recursive calculation
</span> <span class="number">10</span><span class="special">,</span>
- <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="number">5</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// access the default thread-pool
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
@@ -192,17 +194,17 @@
</p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">(),</span> <span class="comment">// sub-task executed in a new thread or inside
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// the thread-pool depending upon the parent
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// the thread-pool depending upon the parent
</span> <span class="identifier">parallel_fib</span><span class="special">,</span> <span class="comment">// task is executed inside a thread-pool or not
</span> <span class="number">10</span><span class="special">,</span>
- <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-</pre>
+ <span class="number">5</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// sub-task executed in a new thread or inside
+</span></pre>
<p>
</p>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a name="ftn.id563974" href="#id563974" class="para">1</a>] </sup>
+<div class="footnote"><p><sup>[<a name="ftn.id584468" href="#id584468" class="para">1</a>] </sup>
more to read at Daniel's blog
</p></div>
</div>
Modified: sandbox/task/libs/task/doc/html/boost_task/new_thread.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/new_thread.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/new_thread.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -30,19 +30,10 @@
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span></code>
creates a new <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span></code> and executes the task in this thread
(asynchronous). The created thread gets joined by handle (so N2802
- should be addressed).
+ should be addressed). The returned <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span></code> joins the thread in its destructor
+ (if the last reference gets out of scope) and thus provides one possible solution
+ of N2880.
</p>
-<div class="caution" title="Caution"><table border="0" summary="Caution">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../doc/html/images/caution.png"></td>
-<th align="left">Caution</th>
-</tr>
-<tr><td align="left" valign="top"><p>
- Always store the returned <span class="emphasis"><em>asynchronous-completion-token</em></span>
- in a variable because <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span></code>
- joins the thread in its destructor (if the last reference gets out of scope).
- </p></td></tr>
-</table></div>
<p>
</p>
@@ -64,15 +55,26 @@
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">fibonacci</span><span class="special">,</span>
- <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(10) == "</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
</p>
+<div class="caution" title="Caution"><table border="0" summary="Caution">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../doc/html/images/caution.png"></td>
+<th align="left">Caution</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Always store the returned <span class="emphasis"><em>asynchronous-completion-token</em></span>
+ in a variable because <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span></code>
+ joins the thread in its destructor (if the last reference gets out of scope).
+ </p></td></tr>
+</table></div>
<p>
In the example below both <code class="computeroutput"><span class="identifier">a_function</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">another_function</span><span class="special">()</span></code> are executed synchron (see <a class="link" href="own_thread.html" title="Execute in own thread"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">own_thread</span></code></a>
for synchronous execution)!
@@ -81,14 +83,12 @@
</p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
- <span class="identifier">a_function</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">a_function</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span>
+
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
- <span class="identifier">another_function</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">another_function</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span>
</pre>
<p>
</p>
Modified: sandbox/task/libs/task/doc/html/boost_task/own_thread.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/own_thread.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/own_thread.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -6,7 +6,7 @@
<meta name="generator" content="DocBook XSL Stylesheets V1.75.0">
<link rel="home" href="../index.html" title="Chapter 1. Boost.Task">
<link rel="up" href="../index.html" title="Chapter 1. Boost.Task">
-<link rel="prev" href="handle.html" title="Handle">
+<link rel="prev" href="async.html" title="Asynchronous execution">
<link rel="next" href="new_thread.html" title="Execute in new thread">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="handle.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="new_thread.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="async.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="new_thread.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Execute in own thread">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -53,10 +53,10 @@
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">own_thread</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">fibonacci</span><span class="special">,</span>
- <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">own_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(10) == "</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
@@ -73,7 +73,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="handle.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="new_thread.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="async.html"><img src="../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="new_thread.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/task/libs/task/doc/html/boost_task/pool.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/pool.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/pool.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -61,10 +61,10 @@
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">echo</span><span class="special">,</span>
- <span class="string">"Hello World!"</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="string">"Hello World!"</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
@@ -90,15 +90,14 @@
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special">,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">echo</span><span class="special">,</span>
- <span class="string">"Hello World!"</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="string">"Hello World!"</span><span class="special">),</span>
+ <span class="identifier">pool</span><span class="special">)</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
- .
</p>
<div class="important" title="Important"><table border="0" summary="Important">
<tr>
@@ -108,7 +107,7 @@
<tr><td align="left" valign="top"><p>
Tasks should not be too small (performance overhead dominates) and avoid
blocking tasks
- <sup>[<a name="id575100" href="#ftn.id575100" class="footnote">4</a>]</sup>
+ <sup>[<a name="id598556" href="#ftn.id598556" class="footnote">5</a>]</sup>
.
</p></td></tr>
</table></div>
@@ -184,7 +183,7 @@
policy (limitation of queued tasks).
</p>
<a name="boost_task.pool.channel._code__phrase_role__identifier__boost__phrase__phrase_role__special______phrase__phrase_role__identifier__task__phrase__phrase_role__special______phrase__phrase_role__identifier__bounded_channel__phrase___code_"></a><h5>
-<a name="id575703"></a>
+<a name="id599159"></a>
<a class="link" href="pool.html#boost_task.pool.channel._code__phrase_role__identifier__boost__phrase__phrase_role__special______phrase__phrase_role__identifier__task__phrase__phrase_role__special______phrase__phrase_role__identifier__bounded_channel__phrase___code_"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">bounded_channel</span></code></a>
</h5>
<p>
@@ -201,7 +200,7 @@
will be woken up if the amount of pending tasks reaches <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">low_watermark</span></code>.
</p>
<a name="boost_task.pool.channel._code__phrase_role__identifier__boost__phrase__phrase_role__special______phrase__phrase_role__identifier__task__phrase__phrase_role__special______phrase__phrase_role__identifier__unbounded_channel__phrase___code_"></a><h5>
-<a name="id575935"></a>
+<a name="id599391"></a>
<a class="link" href="pool.html#boost_task.pool.channel._code__phrase_role__identifier__boost__phrase__phrase_role__special______phrase__phrase_role__identifier__task__phrase__phrase_role__special______phrase__phrase_role__identifier__unbounded_channel__phrase___code_"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span></code></a>
</h5>
<p>
@@ -220,7 +219,7 @@
The scheduling policy determines how tasks are scheduled inside the <span class="emphasis"><em>channel</em></span>.
</p>
<a name="boost_task.pool.scheduling.fifo"></a><h5>
-<a name="id576076"></a>
+<a name="id599532"></a>
<a class="link" href="pool.html#boost_task.pool.scheduling.fifo">fifo</a>
</h5>
<p>
@@ -228,7 +227,7 @@
gets taken first.
</p>
<a name="boost_task.pool.scheduling.priority"></a><h5>
-<a name="id576127"></a>
+<a name="id599583"></a>
<a class="link" href="pool.html#boost_task.pool.scheduling.priority">priority</a>
</h5>
<p>
@@ -244,14 +243,14 @@
</span><span class="special">></span> <span class="identifier">pool</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">poolsize</span><span class="special">(</span> <span class="number">5</span><span class="special">)</span> <span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special">,</span> <span class="comment">// thread-pool
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">some_fn</span><span class="special">),</span> <span class="comment">// task to be executed
-</span> <span class="number">5</span><span class="special">);</span> <span class="comment">// priority is 5
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">some_fn</span><span class="special">),</span> <span class="comment">// task to be executed
+</span> <span class="number">5</span><span class="special">,</span> <span class="comment">// priority is 5
+</span> <span class="identifier">pool</span><span class="special">);</span> <span class="comment">// thread-pool
</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special">,</span> <span class="comment">// thread-pool
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">another_fn</span><span class="special">),</span> <span class="comment">// task to be executed
-</span> <span class="number">3</span><span class="special">);</span> <span class="comment">// priority is 3
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">another_fn</span><span class="special">),</span> <span class="comment">// task to be executed
+</span> <span class="number">3</span><span class="special">,</span> <span class="comment">// priority is 3
+</span> <span class="identifier">pool</span><span class="special">);</span> <span class="comment">// thread-pool
</span></pre>
<p>
</p>
@@ -275,7 +274,7 @@
<p>
</p>
<a name="boost_task.pool.scheduling.smart"></a><h5>
-<a name="id576914"></a>
+<a name="id600370"></a>
<a class="link" href="pool.html#boost_task.pool.scheduling.smart">smart</a>
</h5>
<p>
@@ -326,16 +325,17 @@
<span class="comment">// replaced by later task with same attribute == 2
</span> <span class="comment">// if still pending in pool
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special">,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">10</span><span class="special">),</span>
- <span class="number">2</span><span class="special">);</span> <span class="comment">// attribute is 2
-</span>
+ <span class="number">2</span><span class="special">,</span> <span class="comment">// attribute is 2
+</span> <span class="identifier">pool</span><span class="special">);</span>
+
<span class="comment">// will replace previous pending task with attribute == 2
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
<span class="identifier">pool</span><span class="special">,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">5</span><span class="special">),</span>
- <span class="number">2</span><span class="special">);</span> <span class="comment">// attribute is 2 too
-</span><span class="special">}</span>
+ <span class="number">2</span><span class="special">,</span> <span class="comment">// attribute is 2 too
+</span> <span class="identifier">pool</span><span class="special">);</span>
+<span class="special">}</span>
</pre>
<p>
</p>
@@ -352,7 +352,7 @@
should be addressed.
</p>
<a name="boost_task.pool.pool_shutdown.shutdown"></a><h5>
-<a name="id578010"></a>
+<a name="id601477"></a>
<a class="link" href="pool.html#boost_task.pool.pool_shutdown.shutdown">Shutdown</a>
</h5>
<p>
@@ -361,15 +361,6 @@
are joined until all pending tasks are processed. No futher tasks can be
submitted.
</p>
-<div class="note" title="Note"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/html/images/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p>
- The deconstructor calls <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code> if the pool was not shutdown yet.
- </p></td></tr>
-</table></div>
<p>
</p>
@@ -401,14 +392,14 @@
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h1</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special">,</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">pool</span><span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h2</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special">,</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">5</span><span class="special">),</span>
+ <span class="identifier">pool</span><span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span>
<span class="identifier">pool</span><span class="special">.</span><span class="identifier">shutdown</span><span class="special">();</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(10) == "</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
@@ -417,8 +408,17 @@
</pre>
<p>
</p>
+<div class="note" title="Note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ The deconstructor calls <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code> if the pool was not shutdown yet.
+ </p></td></tr>
+</table></div>
<a name="boost_task.pool.pool_shutdown.shutdown_immediatly"></a><h5>
-<a name="id579109"></a>
+<a name="id602564"></a>
<a class="link" href="pool.html#boost_task.pool.pool_shutdown.shutdown_immediatly">Shutdown
immediatly</a>
</h5>
@@ -457,14 +457,14 @@
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h1</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special">,</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">pool</span><span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h2</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special">,</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">5</span><span class="special">),</span>
+ <span class="identifier">pool</span><span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span>
<span class="identifier">pool</span><span class="special">.</span><span class="identifier">shutdown_now</span><span class="special">();</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(10) == "</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span> <span class="comment">// may throw broken_task or task_interrupted
@@ -508,14 +508,14 @@
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h1</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">(),</span> <span class="comment">// asynchronous executor == default-pool
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy == default-pool
+</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h2</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">(),</span> <span class="comment">// asynchronous executor == default-pool
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
-
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">fibonacci_fn</span><span class="special">,</span> <span class="number">5</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy == default-pool
+</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(10) == "</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(5) == "</span> <span class="special"><<</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
@@ -670,18 +670,20 @@
<span class="special">{</span>
<span class="comment">// fork a sub-task calculating fibonacci(n-1)
</span> <span class="identifier">h1</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">parallel_fib</span><span class="special">,</span>
<span class="identifier">n</span> <span class="special">-</span> <span class="number">1</span><span class="special">,</span>
- <span class="identifier">cutof</span><span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">cutof</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">()</span> <span class="special">);</span>
+
<span class="comment">// fork a sub-task calculating fibonacci(n-2)
</span> <span class="identifier">h2</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">(),</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">parallel_fib</span><span class="special">,</span>
<span class="identifier">n</span> <span class="special">-</span> <span class="number">2</span><span class="special">,</span>
- <span class="identifier">cutof</span><span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">cutof</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">()</span> <span class="special">);</span>
+
<span class="comment">// join the results of both sub-tasks
</span> <span class="comment">// if one of the both sub-tasks is not ready
</span> <span class="comment">// the worker-thread does not block, it executes other
@@ -692,14 +694,14 @@
<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// handle for fibonacci calculation
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// handle for fibonacci calculation
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">(),</span> <span class="comment">// access the default thread-pool
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// calculate fibonacci number 10
-</span> <span class="identifier">parallel_fib</span><span class="special">,</span> <span class="comment">// for numbers < 5 do inline recursive calculation
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// calculate fibonacci number 10
+</span> <span class="identifier">parallel_fib</span><span class="special">,</span> <span class="comment">// for numbers < 5 do inline recursive calculation
</span> <span class="number">10</span><span class="special">,</span>
- <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="number">5</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// access the default thread-pool
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
@@ -707,7 +709,7 @@
</div>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a name="ftn.id575100" href="#id575100" class="para">4</a>] </sup>
+<div class="footnote"><p><sup>[<a name="ftn.id598556" href="#id598556" class="para">5</a>] </sup>
see <a href="http://www.ddj.com/go-parallel/article/showArticle.jhtml?articleID=216500409" target="_top">'Use
Thread Pools Correctly'</a>, Herb Sutter
</p></div>
Modified: sandbox/task/libs/task/doc/html/boost_task/reference.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/reference.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/reference.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -29,11 +29,29 @@
<div class="toc"><dl>
<dt><span class="section"> Class template task
</span></dt>
<dt><span class="section"> Class template handle
</span></dt>
-<dt><span class="section"> Function async()
</span></dt>
+<dt><span class="section"><a href="reference.html#boost_task.reference.async"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">EP</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_task.reference.async1"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">pool</span><span class="special"><</span>
+ <span class="identifier">Channel</span> <span class="special">></span>
+ <span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_task.reference.async2"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">Attr</span><span class="special">,</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span> <span class="special">></span> <span class="special">&)</span></code></a></span></dt>
<dt><span class="section"> Class own_thread
</span></dt>
<dt><span class="section"> Class new_thread
</span></dt>
<dt><span class="section"> Class template static_pool
</span></dt>
-<dt><span class="section"> Utilities</span></dt>
+<dt><span class="section"><a href="reference.html#boost_task.reference.reschedule_until"> Non-member function
+ <code class="computeroutput"><span class="identifier">reschedule_until</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_task.reference.get_pool"> Non-member function
+ <code class="computeroutput"><span class="identifier">get_pool</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_task.reference.runs_in_pool"> Non-member function
+ <code class="computeroutput"><span class="identifier">runs_in_pool</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_task.reference.worker_id"> Non-member function
+ <code class="computeroutput"><span class="identifier">worker_id</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"> Non-member function delay()
</span></dt>
+<dt><span class="section"> Non-member function yield()
</span></dt>
+<dt><span class="section"><a href="reference.html#boost_task.reference.interrupt"> Non-member function
+ <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a></span></dt>
<dt><span class="section"> Meta function has_attribute
</span></dt>
<dt><span class="section"><a href="reference.html#boost_task.reference.attribute_type"> Meta function
<code class="computeroutput"><span class="identifier">attribute_type</span></code></a></span></dt>
@@ -51,16 +69,6 @@
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.task"></a><a class="link" href="reference.html#boost_task.reference.task" title="Class template task"> Class template <code class="computeroutput"><span class="identifier">task</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"> Constructor</span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.task.get_id"> Member function
- <code class="computeroutput"><span class="identifier">get_id</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.task.get_future"> Member function
- <code class="computeroutput"><span class="identifier">get_future</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"> Member function swap()
</span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.task.operator"> Member function
- <code class="computeroutput"><span class="keyword">operator</span><span class="special">()()</span></code></a></span></dt>
-</dl></div>
<p>
</p>
@@ -80,14 +88,22 @@
<span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">other</span><span class="special">)</span> <span class="comment">// throw();
</span>
<span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()()</span> <span class="comment">// throw();
-</span><span class="special">}</span>
+</span><span class="special">};</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A0</span> <span class="special">></span>
+<span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">></span> <span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">A0</span> <span class="identifier">a0</span><span class="special">);</span>
+
+<span class="special">...</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">A10</span> <span class="special">></span>
+<span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">></span> <span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">A0</span> <span class="identifier">a0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">A10</span> <span class="identifier">a10</span><span class="special">);</span>
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.task.constructor"></a><a class="link" href="reference.html#boost_task.reference.task.constructor" title="Constructor"> Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.task.constructor"></a><h5>
+<a name="id608452"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Fn</span> <span class="special">></span>
<span class="identifier">task</span><span class="special">(</span> <span class="identifier">Fn</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">fn</span><span class="special">)</span>
</pre>
@@ -96,21 +112,21 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span>
- <span class="special">></span></code> from a function object
- </p></dd>
+ constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special"><</span>
+ <span class="identifier">R</span> <span class="special">></span></code>
+ from a function object
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function get_id()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.task.get_id"></a><a class="link" href="reference.html#boost_task.reference.task.get_id" title="Member function get_id()"> Member function
+<a name="boost_task.reference.task.function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id608615"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_">function
<code class="computeroutput"><span class="identifier">get_id</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">id</span> <span class="identifier">get_id</span><span class="special">()</span> <span class="keyword">const</span>
</pre>
<div class="variablelist">
@@ -118,20 +134,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns task identifier
- </p></dd>
+ returns task identifier
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function get_future()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.task.get_future"></a><a class="link" href="reference.html#boost_task.reference.task.get_future" title="Member function get_future()"> Member function
- <code class="computeroutput"><span class="identifier">get_future</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.task.member_function__code__phrase_role__identifier__get_future__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id608714"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.member_function__code__phrase_role__identifier__get_future__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">get_future</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="identifier">shared_future</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">get_future</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -139,19 +154,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns a future assiciated with the task
- </p></dd>
+ returns a future assiciated with the task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- ???
- </p></dd>
+ ???
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function swap()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.task.swap"></a><a class="link" href="reference.html#boost_task.reference.task.swap" title="Member function swap()"> Member function <code class="computeroutput"><span class="identifier">swap</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.task.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id608824"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">swap</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">other</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -159,20 +174,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- swaps the task
- </p></dd>
+ swaps the task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function operator()()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.task.operator"></a><a class="link" href="reference.html#boost_task.reference.task.operator" title="Member function operator()()"> Member function
- <code class="computeroutput"><span class="keyword">operator</span><span class="special">()()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.task.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special________phrase___code_"></a><h5>
+<a name="id608948"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special________phrase___code_">Member
+ function <code class="computeroutput"><span class="keyword">operator</span><span class="special">()()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()()</span>
</pre>
<div class="variablelist">
@@ -180,47 +194,45 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- executes tasks internal function object
- </p></dd>
+ executes tasks internal function object
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
+<a name="boost_task.reference.task.free_function__code__phrase_role__identifier__make_task__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id609037"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.free_function__code__phrase_role__identifier__make_task__phrase__phrase_role__special______phrase___code_">Free
+ function <code class="computeroutput"><span class="identifier">make_task</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A0</span> <span class="special">></span>
+<span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">></span> <span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">A0</span> <span class="identifier">a0</span><span class="special">);</span>
+
+<span class="special">...</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Fn</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A0</span><span class="special">,</span> <span class="special">...,</span> <span class="keyword">typename</span> <span class="identifier">A10</span> <span class="special">></span>
+<span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">></span> <span class="identifier">make_task</span><span class="special">(</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">A0</span> <span class="identifier">a0</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">A10</span> <span class="identifier">a10</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ creates an task from function object and arguments
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
</div>
</div>
<div class="section" title="Class template handle">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.handle"></a><a class="link" href="reference.html#boost_task.reference.handle" title="Class template handle"> Class template <code class="computeroutput"><span class="identifier">handle</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"> Constructor</span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.get_id"> Member function
- <code class="computeroutput"><span class="identifier">get_id</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.interruption_requested">
- Member function <code class="computeroutput"><span class="identifier">interruption_requested</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.interrupt"> Member function
- <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.interrupt_and_wait"> Member
- function <code class="computeroutput"><span class="identifier">interrupt_and_wait</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.interrupt_and_wait_until">
- Member function <code class="computeroutput"><span class="identifier">interrupt_and_wait_until</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.interrupt_and_wait_for">
- Member function <code class="computeroutput"><span class="identifier">interrupt_and_wait_for</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.get"> Member function
- <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.wait"> Member function
- <code class="computeroutput"><span class="identifier">wait</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.is_ready"> Member function
- <code class="computeroutput"><span class="identifier">is_ready</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.has_value"> Member function
- <code class="computeroutput"><span class="identifier">has_value</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.has_exception"> Member
- function <code class="computeroutput"><span class="identifier">has_exception</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.handle.swap"> Member function
- <code class="computeroutput"><span class="identifier">swap</span><span class="special">()</span></code></a></span></dt>
-</dl></div>
<p>
</p>
@@ -254,15 +266,47 @@
<span class="keyword">void</span> <span class="identifier">wait</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="identifier">shared_future</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">get_future</span><span class="special">();</span>
+
<span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">other</span><span class="special">);</span>
<span class="special">};</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Iterator</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">Iterator</span> <span class="identifier">begin</span><span class="special">,</span> <span class="identifier">Iterator</span> <span class="identifier">end</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">T1</span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">T2</span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T4</span> <span class="special">></span> <span class="s
pecial">&</span> <span class="identifier">t4</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T5</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T4</span> <span class="special">></span> <span class="s
pecial">&</span> <span class="identifier">t4</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T5</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t5</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Iterator</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="identifier">Iterator</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">Iterator</span> <span class="identifier">begin</span><span class="special">,</span> <span class="identifier">Iterator</span> <span class="identifier">end</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T4</span> <span class
="special">></span> <span class="special">&</span> <span class="identifier">t4</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T5</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T4</span> <span class
="special">></span> <span class="special">&</span> <span class="identifier">t4</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T5</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t5</span><span class="special">);</span>
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.constructor"></a><a class="link" href="reference.html#boost_task.reference.handle.constructor" title="Constructor"> Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.constructor"></a><h5>
+<a name="id611827"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="identifier">handle</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -270,20 +314,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs an empty (invalid) handle
- </p></dd>
+ constructs an empty (invalid) handle
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function get_id()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.get_id"></a><a class="link" href="reference.html#boost_task.reference.handle.get_id" title="Member function get_id()"> Member function
- <code class="computeroutput"><span class="identifier">get_id</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id611893"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">get_id</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">id</span> <span class="identifier">get_id</span><span class="special">()</span> <span class="keyword">const</span>
</pre>
<div class="variablelist">
@@ -291,20 +334,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns identifier of the associated task
- </p></dd>
+ returns identifier of the associated task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function interruption_requested()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.interruption_requested"></a><a class="link" href="reference.html#boost_task.reference.handle.interruption_requested" title="Member function interruption_requested()">
- Member function <code class="computeroutput"><span class="identifier">interruption_requested</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__interruption_requested__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id611992"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__interruption_requested__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">interruption_requested</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">interruption_requested</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -312,20 +354,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- checks if interruption is already requested
- </p></dd>
+ checks if interruption is already requested
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function interrupt()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.interrupt"></a><a class="link" href="reference.html#boost_task.reference.handle.interrupt" title="Member function interrupt()"> Member function
- <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612081"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -333,20 +374,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- requests task interruption; doesn not block (immediatly returns)
- </p></dd>
+ requests task interruption; doesn not block (immediatly returns)
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- ???
- </p></dd>
+ ???
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function interrupt_and_wait()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.interrupt_and_wait"></a><a class="link" href="reference.html#boost_task.reference.handle.interrupt_and_wait" title="Member function interrupt_and_wait()"> Member
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612170"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait__phrase__phrase_role__special______phrase___code_">Member
function <code class="computeroutput"><span class="identifier">interrupt_and_wait</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt_and_wait</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -354,20 +394,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- requests task interruption and blocks until worker-thread stops task
- </p></dd>
+ requests task interruption and blocks until worker-thread stops task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- ???
- </p></dd>
+ ???
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function interrupt_and_wait_until()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.interrupt_and_wait_until"></a><a class="link" href="reference.html#boost_task.reference.handle.interrupt_and_wait_until" title="Member function interrupt_and_wait_until()">
- Member function <code class="computeroutput"><span class="identifier">interrupt_and_wait_until</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait_until__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612259"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait_until__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">interrupt_and_wait_until</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt_and_wait_until</span><span class="special">(</span> <span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">abs_time</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -375,21 +414,20 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- requests task interruption and blocks until worker-thread stops task
- or time-point elapsed
- </p></dd>
+ requests task interruption and blocks until worker-thread stops task
+ or time-point elapsed
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- ???
- </p></dd>
+ ???
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function interrupt_and_wait_for()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.interrupt_and_wait_for"></a><a class="link" href="reference.html#boost_task.reference.handle.interrupt_and_wait_for" title="Member function interrupt_and_wait_for()">
- Member function <code class="computeroutput"><span class="identifier">interrupt_and_wait_for</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait_for__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612375"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt_and_wait_for__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">interrupt_and_wait_for</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Duration</span> <span class="special">></span>
<span class="keyword">void</span> <span class="identifier">interrupt_and_wait_for</span><span class="special">(</span> <span class="identifier">Duration</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rel_time</span><span class="special">)</span>
</pre>
@@ -398,21 +436,20 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- requests task interruption and blocks until worker-thread stops task
- or time-duration elapsed
- </p></dd>
+ requests task interruption and blocks until worker-thread stops task
+ or time-duration elapsed
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- ???
- </p></dd>
+ ???
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function get()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.get"></a><a class="link" href="reference.html#boost_task.reference.handle.get" title="Member function get()"> Member function
- <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__get__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612518"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__get__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="identifier">R</span> <span class="identifier">get</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -420,20 +457,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- requests the result
- </p></dd>
+ requests the result
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- task_interrupted, task_uninialized
- </p></dd>
+ task_interrupted, task_uninialized
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function wait()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.wait"></a><a class="link" href="reference.html#boost_task.reference.handle.wait" title="Member function wait()"> Member function
- <code class="computeroutput"><span class="identifier">wait</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612605"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__wait__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">wait</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">wait</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -441,20 +477,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- blocks caller until task is done
- </p></dd>
+ blocks caller until task is done
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- task_interrupted, task_uninialized
- </p></dd>
+ task_interrupted, task_uninialized
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function is_ready()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.is_ready"></a><a class="link" href="reference.html#boost_task.reference.handle.is_ready" title="Member function is_ready()"> Member function
- <code class="computeroutput"><span class="identifier">is_ready</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__is_ready__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612693"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__is_ready__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">is_ready</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">is_ready</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -462,20 +497,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- checks if task is done
- </p></dd>
+ checks if task is done
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function has_value()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.has_value"></a><a class="link" href="reference.html#boost_task.reference.handle.has_value" title="Member function has_value()"> Member function
- <code class="computeroutput"><span class="identifier">has_value</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__has_value__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612780"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__has_value__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">has_value</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">has_value</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -483,20 +517,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- checks if task is done and a result value is set
- </p></dd>
+ checks if task is done and a result value is set
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function has_exception()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.has_exception"></a><a class="link" href="reference.html#boost_task.reference.handle.has_exception" title="Member function has_exception()"> Member
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__has_exception__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612868"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__has_exception__phrase__phrase_role__special______phrase___code_">Member
function <code class="computeroutput"><span class="identifier">has_exception</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">has_exception</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -504,20 +537,39 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- checks if task is done and an exception is set
- </p></dd>
+ checks if task is done and an exception is set
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__get_future__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id612957"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__get_future__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">get_future</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="identifier">shared_future</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">get_future</span><span class="special">()</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns a reference to the internal shared_future< R >
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
</div>
-<div class="section" title="Member function swap()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.handle.swap"></a><a class="link" href="reference.html#boost_task.reference.handle.swap" title="Member function swap()"> Member function
- <code class="computeroutput"><span class="identifier">swap</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id613067"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">swap</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">other</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -525,146 +577,177 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- swapps handle
- </p></dd>
+ swapps handle
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
+<a name="boost_task.reference.handle.non_member_function__code__phrase_role__identifier__wait_for_all__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id613193"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.non_member_function__code__phrase_role__identifier__wait_for_all__phrase__phrase_role__special______phrase___code_">Non-member
+ function <code class="computeroutput"><span class="identifier">wait_for_all</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Iterator</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">Iterator</span> <span class="identifier">begin</span><span class="special">,</span> <span class="identifier">Iterator</span> <span class="identifier">end</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">T1</span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">T2</span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T4</span> <span class="special">></span> <span class="s
pecial">&</span> <span class="identifier">t4</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T5</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T4</span> <span class="special">></span> <span class="s
pecial">&</span> <span class="identifier">t4</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T5</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t5</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ waits for all handles to become ready
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
</div>
+<a name="boost_task.reference.handle.non_member_function__code__phrase_role__identifier__wait_for_any__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id614186"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.non_member_function__code__phrase_role__identifier__wait_for_any__phrase__phrase_role__special______phrase___code_">Non-member
+ function <code class="computeroutput"><span class="identifier">wait_for_any</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">Iterator</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="identifier">Iterator</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">Iterator</span> <span class="identifier">begin</span><span class="special">,</span> <span class="identifier">Iterator</span> <span class="identifier">end</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T4</span> <span class
="special">></span> <span class="special">&</span> <span class="identifier">t4</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T5</span> <span class="special">></span>
+<span class="keyword">friend</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">waitfor_any</span><span class="special">(</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T1</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T2</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T3</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T4</span> <span class
="special">></span> <span class="special">&</span> <span class="identifier">t4</span><span class="special">,</span> <span class="identifier">handle</span><span class="special"><</span> <span class="identifier">T5</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">t5</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ waits for any handle to become ready
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
</div>
-<div class="section" title="Function async()">
+</div>
+<div class="section" title="Non-member function async( task< R >, EP)">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_task.reference.async"></a><a class="link" href="reference.html#boost_task.reference.async" title="Function async()"> Function <code class="computeroutput"><span class="identifier">async</span><span class="special">()</span></code></a>
+<a name="boost_task.reference.async"></a><a class="link" href="reference.html#boost_task.reference.async" title="Non-member function async( task< R >, EP)"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">EP</span><span class="special">)</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"><a href="reference.html#boost_task.reference.async.async_default"> Templated
- non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">AE</span><span class="special">,</span>
- <span class="identifier">task</span><span class="special"><</span>
- <span class="identifier">R</span> <span class="special">>)</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.async.async_pool"> Templated non-member
- function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special"><</span>
- <span class="identifier">Channel</span> <span class="special">></span>
- <span class="special">&,</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>)</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.async.async_pool_attr"> Templated
- non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span>
- <span class="special">></span> <span class="special">&,</span>
- <span class="identifier">task</span><span class="special"><</span>
- <span class="identifier">R</span> <span class="special">>,</span>
- <span class="identifier">Attr</span><span class="special">)</span></code></a></span></dt>
-</dl></div>
-<div class="section" title="Templated non-member function async( AE, task< R >)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.async.async_default"></a><a class="link" href="reference.html#boost_task.reference.async.async_default" title="Templated non-member function async( AE, task< R >)"> Templated
- non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">AE</span><span class="special">,</span>
- <span class="identifier">task</span><span class="special"><</span>
- <span class="identifier">R</span> <span class="special">>)</span></code></a>
-</h4></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">async</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">AE</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">></span>
-<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">AE</span> <span class="identifier">ae</span><span class="special">,</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">t</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">EP</span> <span class="special">></span>
+<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">t</span><span class="special">,</span> <span class="identifier">EP</span> <span class="identifier">ep</span><span class="special">);</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- executes task in an asyncrounous executer and returns a handle associated
- with the task
- </p></dd>
+ executes task in an asyncrounous executer and returns a handle associated
+ with the task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-<div class="section" title="Templated non-member function async( pool< Channel > &, task< R >)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.async.async_pool"></a><a class="link" href="reference.html#boost_task.reference.async.async_pool" title="Templated non-member function async( pool< Channel > &, task< R >)"> Templated non-member
- function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">pool</span><span class="special"><</span>
- <span class="identifier">Channel</span> <span class="special">></span>
- <span class="special">&,</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>)</span></code></a>
-</h4></div></div></div>
+<div class="section" title="Non-member function async( task< R >, pool< Channel > &)">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.async1"></a><a class="link" href="reference.html#boost_task.reference.async1" title="Non-member function async( task< R >, pool< Channel > &)"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">pool</span><span class="special"><</span>
+ <span class="identifier">Channel</span> <span class="special">></span>
+ <span class="special">&)</span></code></a>
+</h3></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">async</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Channel</span> <span class="special">></span>
-<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">ae</span><span class="special">,</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">t</span><span class="special">);</span>
+<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">t</span><span class="special">,</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">ep</span><span class="special">);</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- executes task in a thread-pool and returns a handle associated with
- the task
- </p></dd>
+ executes task in a thread-pool and returns a handle associated with the
+ task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-<div class="section" title="Templated non-member function async( pool< Channel > &, task< R >, Attr)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.async.async_pool_attr"></a><a class="link" href="reference.html#boost_task.reference.async.async_pool_attr" title="Templated non-member function async( pool< Channel > &, task< R >, Attr)"> Templated
- non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span>
- <span class="special">></span> <span class="special">&,</span>
- <span class="identifier">task</span><span class="special"><</span>
- <span class="identifier">R</span> <span class="special">>,</span>
- <span class="identifier">Attr</span><span class="special">)</span></code></a>
-</h4></div></div></div>
+<div class="section" title="Non-member function async( task< R >, Attr, pool< Channel > &)">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.async2"></a><a class="link" href="reference.html#boost_task.reference.async2" title="Non-member function async( task< R >, Attr, pool< Channel > &)"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">Attr</span><span class="special">,</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span> <span class="special">></span> <span class="special">&)</span></code></a>
+</h3></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">async</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Channel</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Attr</span> <span class="special">></span>
-<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">ae</span><span class="special">,</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">t</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="identifier">attr</span><span class="special">);</span>
+<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">t</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="identifier">attr</span><span class="special">,</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span> <span class="special">></span> <span class="special">&</span> <span class="identifier">ep</span><span class="special">);</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- executes atrributed task in a thread-pool and returns a handle associated
- with the task
- </p></dd>
+ executes atrributed task in a thread-pool and returns a handle associated
+ with the task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class own_thread">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.own_thread"></a><a class="link" href="reference.html#boost_task.reference.own_thread" title="Class own_thread"> Class <code class="computeroutput"><span class="identifier">own_thread</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_task.reference.own_thread.operator"> Member function
- <code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span>
- <span class="identifier">task</span><span class="special"><</span>
- <span class="identifier">R</span> <span class="special">></span>
- <span class="identifier">t</span><span class="special">)</span></code></a></span></dt></dl></div>
<p>
</p>
@@ -678,14 +761,14 @@
</pre>
<p>
</p>
-<div class="section" title="Member function operator()( task< R > t)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.own_thread.operator"></a><a class="link" href="reference.html#boost_task.reference.own_thread.operator" title="Member function operator()( task< R > t)"> Member function
- <code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span>
+<a name="boost_task.reference.own_thread.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___phrase_role__identifier__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__identifier__t__phrase__phrase_role__special_____phrase___code_"></a><h5>
+<a name="id616358"></a>
+ <a class="link" href="reference.html#boost_task.reference.own_thread.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___phrase_role__identifier__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__identifier__t__phrase__phrase_role__special_____phrase___code_">Member
+ function <code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span>
<span class="identifier">task</span><span class="special"><</span>
<span class="identifier">R</span> <span class="special">></span>
<span class="identifier">t</span><span class="special">)</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">></span>
<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">t</span><span class="special">)</span>
</pre>
@@ -694,26 +777,20 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- executes task in the current thread an returns an handle associated
- with the task
- </p></dd>
+ executes task in the current thread an returns an handle associated with
+ the task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class new_thread">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.new_thread"></a><a class="link" href="reference.html#boost_task.reference.new_thread" title="Class new_thread"> Class <code class="computeroutput"><span class="identifier">new_thread</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_task.reference.new_thread.operator"> Member function
- <code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span>
- <span class="identifier">task</span><span class="special"><</span>
- <span class="identifier">R</span> <span class="special">></span>
- <span class="identifier">t</span><span class="special">)</span></code></a></span></dt></dl></div>
<p>
</p>
@@ -727,14 +804,14 @@
</pre>
<p>
</p>
-<div class="section" title="Member function operator()( task< R > t)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.new_thread.operator"></a><a class="link" href="reference.html#boost_task.reference.new_thread.operator" title="Member function operator()( task< R > t)"> Member function
- <code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span>
+<a name="boost_task.reference.new_thread.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___phrase_role__identifier__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__identifier__t__phrase__phrase_role__special_____phrase___code_"></a><h5>
+<a name="id616754"></a>
+ <a class="link" href="reference.html#boost_task.reference.new_thread.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___phrase_role__identifier__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__identifier__t__phrase__phrase_role__special_____phrase___code_">Member
+ function <code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span>
<span class="identifier">task</span><span class="special"><</span>
<span class="identifier">R</span> <span class="special">></span>
<span class="identifier">t</span><span class="special">)</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">></span>
<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">t</span><span class="special">)</span>
</pre>
@@ -743,68 +820,20 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- executes task in a new thread an returns an handle associated with
- the task
- </p></dd>
+ executes task in a new thread an returns an handle associated with the
+ task
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class template static_pool">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.static_pool"></a><a class="link" href="reference.html#boost_task.reference.static_pool" title="Class template static_pool"> Class template <code class="computeroutput"><span class="identifier">static_pool</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.constructor_unbounded_channel_hw">
- Constructor (unbounded channel)</a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.constructor_unbounded_channel">
- Constructor (unbounded channel)</a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.constructor_bounded_channel_hw">
- Constructor (bounded channel)</a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.constructor_bounded_channel">
- Constructor (bounded channel)</a></span></dt>
-<dt><span class="section"> Destructor</span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.size"> Member function
- <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.active"> Member function
- <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.idle"> Member function
- <code class="computeroutput"><span class="identifier">idle</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.shutdown"> Member
- function <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.shutdown_now"> Member
- function <code class="computeroutput"><span class="identifier">shutdown_now</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.losed"> Member function
- <code class="computeroutput"><span class="identifier">closed</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.clear"> Member function
- <code class="computeroutput"><span class="identifier">clear</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.empty"> Member function
- <code class="computeroutput"><span class="identifier">empty</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.pending"> Member function
- <code class="computeroutput"><span class="identifier">pending</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.get_upper_bound">
- Member function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.set_upper_bound">
- Member function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">(</span> <span class="identifier">high_watermark</span>
- <span class="keyword">const</span><span class="special">&</span>
- <span class="identifier">hwm</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.get_lower_bound">
- Member function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.set_lower_bound">
- Member function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">(</span> <span class="identifier">low_watermark</span>
- <span class="keyword">const</span><span class="special">&</span>
- <span class="identifier">lwm</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.submit"> Member function
- <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
- <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">act</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.static_pool.submit_attr"> Member
- function <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
- <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">act</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">attr</span><span class="special">)</span></code></a></span></dt>
-</dl></div>
<p>
</p>
@@ -865,11 +894,11 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor (unbounded channel)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.constructor_unbounded_channel_hw"></a><a class="link" href="reference.html#boost_task.reference.static_pool.constructor_unbounded_channel_hw" title="Constructor (unbounded channel)">
- Constructor (unbounded channel)</a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.constructor__unbounded_channel_"></a><h5>
+<a name="id618368"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.constructor__unbounded_channel_">Constructor
+ (unbounded channel)</a>
+ </h5>
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">static_pool</span><span class="special">(</span>
<span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span> <span class="number">10</span><span class="special">),</span>
<span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">)</span>
@@ -879,30 +908,29 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- operating system provides functionality for processor pining
- </p></dd>
+ operating system provides functionality for processor pining
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a pool - for each processor a worker-thread is created and
- bound to one processor - global-queue can queue an unlimited number
- of tasks
- </p></dd>
+ constructs a pool - for each processor a worker-thread is created and
+ bound to one processor - global-queue can queue an unlimited number of
+ tasks
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- constructor has to be called if a unbounded-channel is used
- </p></dd>
+ constructor has to be called if a unbounded-channel is used
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Constructor (unbounded channel)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.constructor_unbounded_channel"></a><a class="link" href="reference.html#boost_task.reference.static_pool.constructor_unbounded_channel" title="Constructor (unbounded channel)">
- Constructor (unbounded channel)</a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.constructor__unbounded_channel_poolsize_"></a><h5>
+<a name="id618643"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.constructor__unbounded_channel_poolsize_">Constructor
+ (unbounded channel/poolsize)</a>
+ </h5>
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">static_pool</span><span class="special">(</span>
<span class="identifier">poolsize</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">psize</span><span class="special">,</span>
<span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span> <span class="number">10</span><span class="special">),</span>
@@ -913,25 +941,24 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a pool containing psize worker-threads - global-queue can
- queue an unlimited number of tasks
- </p></dd>
+ constructs a pool containing psize worker-threads - global-queue can
+ queue an unlimited number of tasks
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- constructor has to be called if a unbounded-channel is used
- </p></dd>
+ constructor has to be called if a unbounded-channel is used
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Constructor (bounded channel)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.constructor_bounded_channel_hw"></a><a class="link" href="reference.html#boost_task.reference.static_pool.constructor_bounded_channel_hw" title="Constructor (bounded channel)">
- Constructor (bounded channel)</a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.constructor__bounded_channel_"></a><h5>
+<a name="id618929"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.constructor__bounded_channel_">Constructor
+ (bounded channel)</a>
+ </h5>
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">static_pool</span><span class="special">(</span>
<span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">hwm</span><span class="special">,</span>
<span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">lwm</span><span class="special">,</span>
@@ -943,31 +970,30 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- operating system provides functionality for processor pining
- </p></dd>
+ operating system provides functionality for processor pining
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a pool - for each processor a worker-thread is created and
- bound to one processor - global-queue can only queue a limited number
- of tasks
- </p></dd>
+ constructs a pool - for each processor a worker-thread is created and
+ bound to one processor - global-queue can only queue a limited number
+ of tasks
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>,
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>,
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- Constructor has to be called if a bounded-channel is used.
- </p></dd>
+ Constructor has to be called if a bounded-channel is used.
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Constructor (bounded channel)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.constructor_bounded_channel"></a><a class="link" href="reference.html#boost_task.reference.static_pool.constructor_bounded_channel" title="Constructor (bounded channel)">
- Constructor (bounded channel)</a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.constructor__bounded_channel_poolsize_"></a><h5>
+<a name="id619283"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.constructor__bounded_channel_poolsize_">Constructor
+ (bounded channel/poolsize)</a>
+ </h5>
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">static_pool</span><span class="special">(</span>
<span class="identifier">poolsize</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">psize</span><span class="special">,</span>
<span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">hwm</span><span class="special">,</span>
@@ -980,25 +1006,24 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a pool containing psize worker-threads - global-queue can
- only queue a limited number of tasks
- </p></dd>
+ constructs a pool containing psize worker-threads - global-queue can
+ only queue a limited number of tasks
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>,
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>,
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- constructor has to be called if a bounded-channel is used
- </p></dd>
+ constructor has to be called if a bounded-channel is used
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Destructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.destructor"></a><a class="link" href="reference.html#boost_task.reference.static_pool.destructor" title="Destructor"> Destructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.destructor"></a><h5>
+<a name="id619650"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.destructor">Destructor</a>
+ </h5>
<pre class="programlisting"><span class="special">~</span><span class="identifier">static_pool</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1006,20 +1031,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- calls <code class="computeroutput"><span class="special">:</span><span class="identifier">shutdown</span><span class="special">()</span></code> if not already called
- </p></dd>
+ calls <code class="computeroutput"><span class="special">:</span><span class="identifier">shutdown</span><span class="special">()</span></code> if not already called
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function size()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.size"></a><a class="link" href="reference.html#boost_task.reference.static_pool.size" title="Member function size()"> Member function
- <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__size__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id619741"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__size__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1027,20 +1051,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns how many worker-threads are running in the pool
- </p></dd>
+ returns how many worker-threads are running in the pool
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function active()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.active"></a><a class="link" href="reference.html#boost_task.reference.static_pool.active" title="Member function active()"> Member function
- <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__active__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id619839"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__active__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">active</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1048,20 +1071,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns how many worker-threads are active (executing an task)
- </p></dd>
+ returns how many worker-threads are active (executing an task)
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function idle()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.idle"></a><a class="link" href="reference.html#boost_task.reference.static_pool.idle" title="Member function idle()"> Member function
- <code class="computeroutput"><span class="identifier">idle</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__idle__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id619936"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__idle__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">idle</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">idle</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1069,24 +1091,23 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns how many worker-threads are idle (not executing an task).
- </p></dd>
+ returns how many worker-threads are idle (not executing an task).
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- The value is the difference of <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code>
- </p></dd>
+ The value is the difference of <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code>
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function shutdown()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.shutdown"></a><a class="link" href="reference.html#boost_task.reference.static_pool.shutdown" title="Member function shutdown()"> Member
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id620077"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown__phrase__phrase_role__special______phrase___code_">Member
function <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">shutdown</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1094,25 +1115,23 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- deactivates the channel and joins all worker-threads - the pool is
- closed
- </p></dd>
+ deactivates the channel and joins all worker-threads - the pool is closed
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- all pending tasks are processed
- </p></dd>
+ all pending tasks are processed
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function shutdown_now()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.shutdown_now"></a><a class="link" href="reference.html#boost_task.reference.static_pool.shutdown_now" title="Member function shutdown_now()"> Member
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown_now__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id620178"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown_now__phrase__phrase_role__special______phrase___code_">Member
function <code class="computeroutput"><span class="identifier">shutdown_now</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">shutdown_now</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1120,25 +1139,24 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- deactivates the channel, send interruption request to all worker-threads
- and joins them - the pool is closed
- </p></dd>
+ deactivates the channel, send interruption request to all worker-threads
+ and joins them - the pool is closed
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- pending tasks are not processed but returned
- </p></dd>
+ pending tasks are not processed but returned
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function closed()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.losed"></a><a class="link" href="reference.html#boost_task.reference.static_pool.losed" title="Member function closed()"> Member function
- <code class="computeroutput"><span class="identifier">closed</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__closed__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id620280"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__closed__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">closed</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">closed</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1146,20 +1164,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- queries if the pool is closed (pool is shutdown)
- </p></dd>
+ queries if the pool is closed (pool is shutdown)
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function clear()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.clear"></a><a class="link" href="reference.html#boost_task.reference.static_pool.clear" title="Member function clear()"> Member function
- <code class="computeroutput"><span class="identifier">clear</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__clear__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id620368"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__clear__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">clear</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">clear</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1167,20 +1184,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- removes all pending tasks from the channel
- </p></dd>
+ removes all pending tasks from the channel
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function empty()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.empty"></a><a class="link" href="reference.html#boost_task.reference.static_pool.empty" title="Member function empty()"> Member function
- <code class="computeroutput"><span class="identifier">empty</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__empty__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id620456"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__empty__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">empty</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1188,20 +1204,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- queries if the channel is empty
- </p></dd>
+ queries if the channel is empty
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function pending()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.pending"></a><a class="link" href="reference.html#boost_task.reference.static_pool.pending" title="Member function pending()"> Member function
- <code class="computeroutput"><span class="identifier">pending</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__pending__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id620544"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__pending__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">pending</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pending</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1209,21 +1224,20 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- queries how many tasks are pending (still unprocessed) in the global-queue
- (channel)
- </p></dd>
+ queries how many tasks are pending (still unprocessed) in the global-queue
+ (channel)
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function upper_bound()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.get_upper_bound"></a><a class="link" href="reference.html#boost_task.reference.static_pool.get_upper_bound" title="Member function upper_bound()">
- Member function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__upper_bound__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id620641"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__upper_bound__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">upper_bound</span><span class="special">()</span>
</pre>
<div class="variablelist">
@@ -1231,30 +1245,28 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- channel is of type bounded-channel
- </p></dd>
+ channel is of type bounded-channel
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns the upper bound of the bounded-channel
- </p></dd>
+ returns the upper bound of the bounded-channel
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- can only be used if a bounded-channel is used
- </p></dd>
+ can only be used if a bounded-channel is used
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function upper_bound( high_watermark const& hwm)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.set_upper_bound"></a><a class="link" href="reference.html#boost_task.reference.static_pool.set_upper_bound" title="Member function upper_bound( high_watermark const& hwm)">
- Member function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">(</span> <span class="identifier">high_watermark</span>
- <span class="keyword">const</span><span class="special">&</span>
- <span class="identifier">hwm</span><span class="special">)</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__upper_bound__phrase__phrase_role__special_____phrase___phrase_role__identifier__high_watermark__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__hwm__phrase__phrase_role__special_____phrase___code_"></a><h5>
+<a name="id620762"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__upper_bound__phrase__phrase_role__special_____phrase___phrase_role__identifier__high_watermark__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__hwm__phrase__phrase_role__special_____phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">(</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">hwm</span><span class="special">)</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">upper_bound</span><span class="special">(</span> <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">hwm</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -1262,33 +1274,32 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- channel is of type bounded-channel
- </p></dd>
+ channel is of type bounded-channel
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- sets the upper bound of the bounded-channel
- </p></dd>
+ sets the upper bound of the bounded-channel
+ </p></dd>
<dt><span class="term">Postconditions:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="keyword">this</span><span class="special">-></span><span class="identifier">upper_bound</span><span class="special">()</span>
- <span class="special">==</span> <span class="identifier">hwm</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-></span><span class="identifier">upper_bound</span><span class="special">()</span>
+ <span class="special">==</span> <span class="identifier">hwm</span></code>
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- can only be used if a bounded-channel is used
- </p></dd>
+ can only be used if a bounded-channel is used
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function lower_bound()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.get_lower_bound"></a><a class="link" href="reference.html#boost_task.reference.static_pool.get_lower_bound" title="Member function lower_bound()">
- Member function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__lower_bound__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id621010"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__lower_bound__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">lower_bound</span><span class="special">();</span>
</pre>
<div class="variablelist">
@@ -1296,30 +1307,28 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- channel is of type bounded-channel
- </p></dd>
+ channel is of type bounded-channel
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns the lower bound of the bounded-channel
- </p></dd>
+ returns the lower bound of the bounded-channel
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- can only be used if a bounded-channel is used
- </p></dd>
+ can only be used if a bounded-channel is used
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function lower_bound( low_watermark const& lwm)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.set_lower_bound"></a><a class="link" href="reference.html#boost_task.reference.static_pool.set_lower_bound" title="Member function lower_bound( low_watermark const& lwm)">
- Member function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">(</span> <span class="identifier">low_watermark</span>
- <span class="keyword">const</span><span class="special">&</span>
- <span class="identifier">lwm</span><span class="special">)</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__lower_bound__phrase__phrase_role__special_____phrase___phrase_role__identifier__low_watermark__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__lwm__phrase__phrase_role__special_____phrase___code_"></a><h5>
+<a name="id621132"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__lower_bound__phrase__phrase_role__special_____phrase___phrase_role__identifier__low_watermark__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__lwm__phrase__phrase_role__special_____phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">(</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">lwm</span><span class="special">)</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">lower_bound</span><span class="special">(</span> <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">lwm</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -1327,34 +1336,33 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- channel is of type bounded-channel
- </p></dd>
+ channel is of type bounded-channel
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- sets the lower bound of the bounded-channel
- </p></dd>
+ sets the lower bound of the bounded-channel
+ </p></dd>
<dt><span class="term">Postconditions:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="keyword">this</span><span class="special">-></span><span class="identifier">lower_bound</span><span class="special">()</span>
- <span class="special">==</span> <span class="identifier">lwm</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-></span><span class="identifier">lower_bound</span><span class="special">()</span>
+ <span class="special">==</span> <span class="identifier">lwm</span></code>
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
<dt><span class="term">Notes:</span></dt>
<dd><p>
- can only be used if a bounded-channel is used
- </p></dd>
+ can only be used if a bounded-channel is used
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function submit( Act const& act)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.submit"></a><a class="link" href="reference.html#boost_task.reference.static_pool.submit" title="Member function submit( Act const& act)"> Member function
- <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__phrase__phrase_role__special_____phrase___phrase_role__identifier__act__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__act__phrase__phrase_role__special_____phrase___code_"></a><h5>
+<a name="id621378"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__phrase__phrase_role__special_____phrase___phrase_role__identifier__act__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__act__phrase__phrase_role__special_____phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
<span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">act</span><span class="special">)</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">></span>
<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">t</span><span class="special">)</span>
</pre>
@@ -1363,25 +1371,24 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- has_attribute< pool >::value == false && ! closed()
- </p></dd>
+ has_attribute< pool >::value == false && ! closed()
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- submits an task to the pool and returns an associated handle
- </p></dd>
+ submits an task to the pool and returns an associated handle
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task_rejected</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task_rejected</span></code>
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function submit( Act const& act, Attr const& attr)">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.static_pool.submit_attr"></a><a class="link" href="reference.html#boost_task.reference.static_pool.submit_attr" title="Member function submit( Act const& act, Attr const& attr)"> Member
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__phrase__phrase_role__special_____phrase___phrase_role__identifier__act__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__act__phrase__phrase_role__special_____phrase___phrase_role__identifier__attr__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__attr__phrase__phrase_role__special_____phrase___code_"></a><h5>
+<a name="id621628"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__phrase__phrase_role__special_____phrase___phrase_role__identifier__act__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__act__phrase__phrase_role__special_____phrase___phrase_role__identifier__attr__phrase___phrase_role__keyword__const__phrase__phrase_role__special___amp___phrase___phrase_role__identifier__attr__phrase__phrase_role__special_____phrase___code_">Member
function <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
<span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">act</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">attr</span><span class="special">)</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> <span class="keyword">typename</span> <span class="identifier">R</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Attr</span> <span class="special">></span>
<span class="identifier">handle</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">t</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">attr</span><span class="special">)</span>
</pre>
@@ -1390,48 +1397,27 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- has_attribute< pool >::value == true && ! closed()
- </p></dd>
+ has_attribute< pool >::value == true && ! closed()
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- submits an task to the pool and returns an associated handle - task
- is scheduled by the attribute
- </p></dd>
+ submits an task to the pool and returns an associated handle - task is
+ scheduled by the attribute
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task_rejected</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task_rejected</span></code>
+ </p></dd>
</dl>
</div>
</div>
-</div>
-<div class="section" title="Utilities">
+<div class="section" title="Non-member function reschedule_until()">
<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_task.reference.utility"></a><a class="link" href="reference.html#boost_task.reference.utility" title="Utilities"> Utilities</a>
+<a name="boost_task.reference.reschedule_until"></a><a class="link" href="reference.html#boost_task.reference.reschedule_until" title="Non-member function reschedule_until()"> Non-member function
+ <code class="computeroutput"><span class="identifier">reschedule_until</span><span class="special">()</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"><a href="reference.html#boost_task.reference.utility.reschedule_until"> Non-member
- function <code class="computeroutput"><span class="identifier">reschedule_until</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.utility.get_pool"> Non-member
- function <code class="computeroutput"><span class="identifier">get_pool</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.utility.runs_in_pool"> Non-member
- function <code class="computeroutput"><span class="identifier">runs_in_pool</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.utility.worker_id"> Non-member
- function <code class="computeroutput"><span class="identifier">worker_id</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.utility.delay"> Non-member function
- <code class="computeroutput"><span class="identifier">delay</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.utility.yield"> Non-member function
- <code class="computeroutput"><span class="identifier">yield</span><span class="special">()</span></code></a></span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.utility.interrupt"> Non-member
- function <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a></span></dt>
-</dl></div>
-<div class="section" title="Non-member function reschedule_until()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.utility.reschedule_until"></a><a class="link" href="reference.html#boost_task.reference.utility.reschedule_until" title="Non-member function reschedule_until()"> Non-member
- function <code class="computeroutput"><span class="identifier">reschedule_until</span><span class="special">()</span></code></a>
-</h4></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1439,36 +1425,36 @@
<span class="keyword">void</span> <span class="identifier">reschedule_until</span><span class="special">(</span> <span class="identifier">Pred</span> <span class="keyword">const</span><span class="special">&)</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd>
<p>
- reschedules current task until passed callable predicate becomes ready
- </p>
+ reschedules current task until passed callable predicate becomes ready
+ </p>
<p>
- [Throws:
- </p>
+ [Throws:
+ </p>
<p>
- Nothing.
- </p>
+ Nothing.
+ </p>
</dd>
<dt><span class="term">Note:</span></dt>
<dd><p>
- This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
- </p></dd>
+ This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
+ </p></dd>
</dl>
</div>
</div>
<div class="section" title="Non-member function get_pool()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.utility.get_pool"></a><a class="link" href="reference.html#boost_task.reference.utility.get_pool" title="Non-member function get_pool()"> Non-member
- function <code class="computeroutput"><span class="identifier">get_pool</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.get_pool"></a><a class="link" href="reference.html#boost_task.reference.get_pool" title="Non-member function get_pool()"> Non-member function
+ <code class="computeroutput"><span class="identifier">get_pool</span><span class="special">()</span></code></a>
+</h3></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1476,109 +1462,108 @@
<span class="identifier">Pool</span> <span class="special">&</span> <span class="identifier">get_pool</span><span class="special">()</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd>
<p>
- returns reference to the thread-pool where the current worker thread
- is executed
- </p>
+ returns reference to the thread-pool where the current worker thread
+ is executed
+ </p>
<p>
- [Throws:
- </p>
+ [Throws:
+ </p>
<p>
- Nothing.
- </p>
+ Nothing.
+ </p>
</dd>
<dt><span class="term">Note:</span></dt>
<dd><p>
- This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
- </p></dd>
+ This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
+ </p></dd>
</dl>
</div>
</div>
<div class="section" title="Non-member function runs_in_pool()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.utility.runs_in_pool"></a><a class="link" href="reference.html#boost_task.reference.utility.runs_in_pool" title="Non-member function runs_in_pool()"> Non-member
- function <code class="computeroutput"><span class="identifier">runs_in_pool</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.runs_in_pool"></a><a class="link" href="reference.html#boost_task.reference.runs_in_pool" title="Non-member function runs_in_pool()"> Non-member function
+ <code class="computeroutput"><span class="identifier">runs_in_pool</span><span class="special">()</span></code></a>
+</h3></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="keyword">bool</span> <span class="identifier">runs_in_pool</span><span class="special">()</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd>
<p>
- returns true if the current task is executed in a thread-pool
- </p>
+ returns true if the current task is executed in a thread-pool
+ </p>
<p>
- [Throws:
- </p>
+ [Throws:
+ </p>
<p>
- Nothing.
- </p>
+ Nothing.
+ </p>
</dd>
<dt><span class="term">Note:</span></dt>
<dd><p>
- This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
- </p></dd>
+ This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
+ </p></dd>
</dl>
</div>
</div>
<div class="section" title="Non-member function worker_id()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.utility.worker_id"></a><a class="link" href="reference.html#boost_task.reference.utility.worker_id" title="Non-member function worker_id()"> Non-member
- function <code class="computeroutput"><span class="identifier">worker_id</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.worker_id"></a><a class="link" href="reference.html#boost_task.reference.worker_id" title="Non-member function worker_id()"> Non-member function
+ <code class="computeroutput"><span class="identifier">worker_id</span><span class="special">()</span></code></a>
+</h3></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="identifier">id</span> <span class="identifier">worker_id</span><span class="special">()</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd>
<p>
- returns returns the thread-id of the worker-thread
- </p>
+ returns returns the thread-id of the worker-thread
+ </p>
<p>
- [Throws:
- </p>
+ [Throws:
+ </p>
<p>
- Nothing.
- </p>
+ Nothing.
+ </p>
</dd>
<dt><span class="term">Note:</span></dt>
<dd><p>
- This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
- </p></dd>
+ This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
+ </p></dd>
</dl>
</div>
</div>
<div class="section" title="Non-member function delay()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.utility.delay"></a><a class="link" href="reference.html#boost_task.reference.utility.delay" title="Non-member function delay()"> Non-member function
- <code class="computeroutput"><span class="identifier">delay</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.delay"></a><a class="link" href="reference.html#boost_task.reference.delay" title="Non-member function delay()"> Non-member function <code class="computeroutput"><span class="identifier">delay</span><span class="special">()</span></code></a>
+</h3></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -1588,104 +1573,102 @@
<span class="keyword">void</span> <span class="identifier">delay</span><span class="special">(</span> <span class="identifier">Duration</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rel_time</span><span class="special">)</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd>
<p>
- delays the execution of the current task so that the worker-thread
- can process another task in the meantime
- </p>
+ delays the execution of the current task so that the worker-thread can
+ process another task in the meantime
+ </p>
<p>
- [Throws:
- </p>
+ [Throws:
+ </p>
<p>
- Nothing.
- </p>
+ Nothing.
+ </p>
</dd>
<dt><span class="term">Note:</span></dt>
<dd><p>
- This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
- </p></dd>
+ This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
+ </p></dd>
</dl>
</div>
</div>
<div class="section" title="Non-member function yield()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.utility.yield"></a><a class="link" href="reference.html#boost_task.reference.utility.yield" title="Non-member function yield()"> Non-member function
- <code class="computeroutput"><span class="identifier">yield</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.yield"></a><a class="link" href="reference.html#boost_task.reference.yield" title="Non-member function yield()"> Non-member function <code class="computeroutput"><span class="identifier">yield</span><span class="special">()</span></code></a>
+</h3></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="keyword">void</span> <span class="identifier">yield</span><span class="special">()</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd>
<p>
- yields the current task so that the worker-threadcan process another
- task in the meantime
- </p>
+ yields the current task so that the worker-threadcan process another
+ task in the meantime
+ </p>
<p>
- [Throws:
- </p>
+ [Throws:
+ </p>
<p>
- Nothing.
- </p>
+ Nothing.
+ </p>
</dd>
<dt><span class="term">Note:</span></dt>
<dd><p>
- This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
- </p></dd>
+ This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
+ </p></dd>
</dl>
</div>
</div>
<div class="section" title="Non-member function interrupt()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.utility.interrupt"></a><a class="link" href="reference.html#boost_task.reference.utility.interrupt" title="Non-member function interrupt()"> Non-member
- function <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.interrupt"></a><a class="link" href="reference.html#boost_task.reference.interrupt" title="Non-member function interrupt()"> Non-member function
+ <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a>
+</h3></div></div></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="keyword">void</span> <span class="identifier">interrupt</span><span class="special">()</span>
</pre>
<p>
- </p>
+ </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd>
<p>
- task can request interruption for itself
- </p>
+ task can request interruption for itself
+ </p>
<p>
- [Throws:
- </p>
+ [Throws:
+ </p>
<p>
- Nothing.
- </p>
+ Nothing.
+ </p>
</dd>
<dt><span class="term">Note:</span></dt>
<dd><p>
- This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
- </p></dd>
+ This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Meta function has_attribute">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.has_attribute"></a><a class="link" href="reference.html#boost_task.reference.has_attribute" title="Meta function has_attribute"> Meta function <code class="computeroutput"><span class="identifier">has_attribute</span></code></a>
@@ -1730,8 +1713,6 @@
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.invalid_poolsize"></a><a class="link" href="reference.html#boost_task.reference.invalid_poolsize" title="Class invalid_poolsize"> Class <code class="computeroutput"><span class="identifier">invalid_poolsize</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_task.reference.invalid_poolsize.constructor">
- Constructor</a></span></dt></dl></div>
<p>
</p>
@@ -1745,11 +1726,10 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.invalid_poolsize.constructor"></a><a class="link" href="reference.html#boost_task.reference.invalid_poolsize.constructor" title="Constructor">
- Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.invalid_poolsize.constructor"></a><h5>
+<a name="id623864"></a>
+ <a class="link" href="reference.html#boost_task.reference.invalid_poolsize.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="identifier">invalid_poolsize</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">msg</span><span class="special">);</span>
</pre>
<div class="variablelist">
@@ -1757,22 +1737,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_poolsize</span></code>
- instance.
- </p></dd>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_poolsize</span></code> instance.
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class invalid_scanns">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.invalid_scanns"></a><a class="link" href="reference.html#boost_task.reference.invalid_scanns" title="Class invalid_scanns"> Class <code class="computeroutput"><span class="identifier">invalid_scanns</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl><dt><span class="section"> Constructor</span></dt></dl></div>
<p>
</p>
@@ -1786,10 +1763,9 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.invalid_scanns.constructor"></a><a class="link" href="reference.html#boost_task.reference.invalid_scanns.constructor" title="Constructor"> Constructor</a>
-</h4></div></div></div>
+<p>
+ heading Constructor]
+ </p>
<pre class="programlisting"><span class="identifier">invalid_scanns</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">msg</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -1797,23 +1773,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>
- instance.
- </p></dd>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code> instance.
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class invalid_timeduration">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.invalid_timeduration"></a><a class="link" href="reference.html#boost_task.reference.invalid_timeduration" title="Class invalid_timeduration"> Class <code class="computeroutput"><span class="identifier">invalid_timeduration</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_task.reference.invalid_timeduration.constructor">
- Constructor</a></span></dt></dl></div>
<p>
</p>
@@ -1827,11 +1799,10 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.invalid_timeduration.constructor"></a><a class="link" href="reference.html#boost_task.reference.invalid_timeduration.constructor" title="Constructor">
- Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.invalid_timeduration.constructor"></a><h5>
+<a name="id624476"></a>
+ <a class="link" href="reference.html#boost_task.reference.invalid_timeduration.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="identifier">invalid_timeduration</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">msg</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -1839,23 +1810,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>
- instance.
- </p></dd>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code> instance.
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class invalid_watermark">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.invalid_watermark"></a><a class="link" href="reference.html#boost_task.reference.invalid_watermark" title="Class invalid_watermark"> Class <code class="computeroutput"><span class="identifier">invalid_watermark</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_task.reference.invalid_watermark.constructor">
- Constructor</a></span></dt></dl></div>
<p>
</p>
@@ -1869,11 +1836,10 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.invalid_watermark.constructor"></a><a class="link" href="reference.html#boost_task.reference.invalid_watermark.constructor" title="Constructor">
- Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.invalid_watermark.constructor"></a><h5>
+<a name="id624789"></a>
+ <a class="link" href="reference.html#boost_task.reference.invalid_watermark.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="identifier">invalid_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">msg</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -1881,22 +1847,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
- instance.
- </p></dd>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code> instance.
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class task_rejected">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.task_rejected"></a><a class="link" href="reference.html#boost_task.reference.task_rejected" title="Class task_rejected"> Class <code class="computeroutput"><span class="identifier">task_rejected</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl><dt><span class="section"> Constructor</span></dt></dl></div>
<p>
</p>
@@ -1910,10 +1873,10 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.task_rejected.constructor"></a><a class="link" href="reference.html#boost_task.reference.task_rejected.constructor" title="Constructor"> Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.task_rejected.constructor"></a><h5>
+<a name="id625103"></a>
+ <a class="link" href="reference.html#boost_task.reference.task_rejected.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="identifier">task_rejected</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">msg</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -1921,26 +1884,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task_rejected</span></code>
- instance.
- </p></dd>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task_rejected</span></code> instance.
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class poolsize">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.poolsize"></a><a class="link" href="reference.html#boost_task.reference.poolsize" title="Class poolsize"> Class <code class="computeroutput"><span class="identifier">poolsize</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"> Constructor</span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.poolsize.operator"> Member function
- <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a></span></dt>
-</dl></div>
<p>
</p>
@@ -1956,10 +1912,10 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.poolsize.constructor"></a><a class="link" href="reference.html#boost_task.reference.poolsize.constructor" title="Constructor"> Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.poolsize.constructor"></a><h5>
+<a name="id625423"></a>
+ <a class="link" href="reference.html#boost_task.reference.poolsize.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">poolsize</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -1967,29 +1923,27 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- value > 0
- </p></dd>
+ value > 0
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">poolsize</span></code>
- instance
- </p></dd>
+ constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">poolsize</span></code> instance
+ </p></dd>
<dt><span class="term">Postconditions:</span></dt>
<dd><p>
- operator std::size_t () > 0
- </p></dd>
+ operator std::size_t () > 0
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_poolsize</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_poolsize</span></code>
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function operator std::size_t()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.poolsize.operator"></a><a class="link" href="reference.html#boost_task.reference.poolsize.operator" title="Member function operator std::size_t()"> Member function
- <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.poolsize.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id625601"></a>
+ <a class="link" href="reference.html#boost_task.reference.poolsize.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span>
</pre>
<div class="variablelist">
@@ -1997,25 +1951,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns the value
- </p></dd>
+ returns the value
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class high_watermark">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.high_watermark"></a><a class="link" href="reference.html#boost_task.reference.high_watermark" title="Class high_watermark"> Class <code class="computeroutput"><span class="identifier">high_watermark</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"> Constructor</span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.high_watermark.operator"> Member
- function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a></span></dt>
-</dl></div>
<p>
</p>
@@ -2031,10 +1979,10 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.high_watermark.constructor"></a><a class="link" href="reference.html#boost_task.reference.high_watermark.constructor" title="Constructor"> Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.high_watermark.constructor"></a><h5>
+<a name="id625913"></a>
+ <a class="link" href="reference.html#boost_task.reference.high_watermark.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">high_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -2042,21 +1990,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">high_watermark</span></code>
- instance
- </p></dd>
+ constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">high_watermark</span></code> instance
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function operator std::size_t()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.high_watermark.operator"></a><a class="link" href="reference.html#boost_task.reference.high_watermark.operator" title="Member function operator std::size_t()"> Member
+<a name="boost_task.reference.high_watermark.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id626065"></a>
+ <a class="link" href="reference.html#boost_task.reference.high_watermark.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_">Member
function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span>
</pre>
<div class="variablelist">
@@ -2064,25 +2010,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns high watermark
- </p></dd>
+ returns high watermark
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class low_watermark">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.low_watermark"></a><a class="link" href="reference.html#boost_task.reference.low_watermark" title="Class low_watermark"> Class <code class="computeroutput"><span class="identifier">low_watermark</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"> Constructor</span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.low_watermark.operator"> Member
- function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a></span></dt>
-</dl></div>
<p>
</p>
@@ -2098,10 +2038,10 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.low_watermark.constructor"></a><a class="link" href="reference.html#boost_task.reference.low_watermark.constructor" title="Constructor"> Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.low_watermark.constructor"></a><h5>
+<a name="id626378"></a>
+ <a class="link" href="reference.html#boost_task.reference.low_watermark.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">low_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -2109,21 +2049,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">low_watermark</span></code>
- instance
- </p></dd>
+ constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">low_watermark</span></code> instance
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function operator std::size_t()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.low_watermark.operator"></a><a class="link" href="reference.html#boost_task.reference.low_watermark.operator" title="Member function operator std::size_t()"> Member
+<a name="boost_task.reference.low_watermark.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id626530"></a>
+ <a class="link" href="reference.html#boost_task.reference.low_watermark.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_">Member
function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+ </h5>
<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span>
</pre>
<div class="variablelist">
@@ -2131,25 +2069,19 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns low watermark
- </p></dd>
+ returns low watermark
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
-</div>
<div class="section" title="Class scanns">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_task.reference.scanns"></a><a class="link" href="reference.html#boost_task.reference.scanns" title="Class scanns"> Class <code class="computeroutput"><span class="identifier">scanns</span></code></a>
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"> Constructor</span></dt>
-<dt><span class="section"><a href="reference.html#boost_task.reference.scanns.operator"> Member function
- <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a></span></dt>
-</dl></div>
<p>
</p>
@@ -2165,10 +2097,10 @@
</pre>
<p>
</p>
-<div class="section" title="Constructor">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.scanns.constructor"></a><a class="link" href="reference.html#boost_task.reference.scanns.constructor" title="Constructor"> Constructor</a>
-</h4></div></div></div>
+<a name="boost_task.reference.scanns.constructor"></a><h5>
+<a name="id626842"></a>
+ <a class="link" href="reference.html#boost_task.reference.scanns.constructor">Constructor</a>
+ </h5>
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">)</span>
</pre>
<div class="variablelist">
@@ -2176,29 +2108,27 @@
<dl>
<dt><span class="term">Preconditions:</span></dt>
<dd><p>
- value > 0
- </p></dd>
+ value > 0
+ </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">scanns</span></code>
- instance
- </p></dd>
+ constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">scanns</span></code> instance
+ </p></dd>
<dt><span class="term">Postconditions:</span></dt>
<dd><p>
- operator std::size_t () > 0
- </p></dd>
+ operator std::size_t () > 0
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_poolsize</span></code>
- </p></dd>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">invalid_poolsize</span></code>
+ </p></dd>
</dl>
</div>
-</div>
-<div class="section" title="Member function operator std::size_t()">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_task.reference.scanns.operator"></a><a class="link" href="reference.html#boost_task.reference.scanns.operator" title="Member function operator std::size_t()"> Member function
- <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
-</h4></div></div></div>
+<a name="boost_task.reference.scanns.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id627019"></a>
+ <a class="link" href="reference.html#boost_task.reference.scanns.member_function__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__std__phrase__phrase_role__special______phrase__phrase_role__identifier__size_t__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
+ </h5>
<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span>
</pre>
<div class="variablelist">
@@ -2206,17 +2136,16 @@
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
- returns the value
- </p></dd>
+ returns the value
+ </p></dd>
<dt><span class="term">Throws:</span></dt>
<dd><p>
- Nothing
- </p></dd>
+ Nothing
+ </p></dd>
</dl>
</div>
</div>
</div>
-</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2009 Oliver Kowalke<p>
Modified: sandbox/task/libs/task/doc/html/boost_task/task.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/task.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/task.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -32,13 +32,13 @@
<p>
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>
represents a <span class="emphasis"><em>callable</em></span> (provides <code class="computeroutput"><span class="keyword">operator</span><span class="special">()()</span></code>) object containing the unit of code to
- be execute by a <span class="emphasis"><em>asynchronous-executor</em></span>. Function <code class="computeroutput"><span class="identifier">get_future</span><span class="special">()</span></code>
+ be execute by a <span class="emphasis"><em>execution-policy</em></span>. Function <code class="computeroutput"><span class="identifier">get_future</span><span class="special">()</span></code>
returns a <span class="emphasis"><em>asynchronous-completion-token</em></span> allowing to wait
for the completion of the computation of the task, for getting the result of
a computation or for transfering exceptions. Each <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code> has a unique identifier.
</p>
<a name="boost_task.task.creation"></a><h4>
-<a name="id566445"></a>
+<a name="id586937"></a>
<a class="link" href="task.html#boost_task.task.creation">Creation</a>
</h4>
<p>
@@ -98,7 +98,7 @@
<p>
</p>
<a name="boost_task.task.cooperative_task_and_interruption"></a><h4>
-<a name="id567014"></a>
+<a name="id587506"></a>
<a class="link" href="task.html#boost_task.task.cooperative_task_and_interruption">Cooperative
task and interruption</a>
</h4>
@@ -108,7 +108,7 @@
its execution. In the context of task-interruption a task is known as cooperative
if it checks for an interruption request between two <span class="emphasis"><em>interruption-points</em></span>
via <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_requested</span><span class="special">()</span></code>
- <sup>[<a name="id567065" href="#ftn.id567065" class="footnote">2</a>]</sup>
+ <sup>[<a name="id587556" href="#ftn.id587556" class="footnote">2</a>]</sup>
.
</p>
<p>
@@ -157,17 +157,17 @@
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// get handle associated with the task
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
</span> <span class="identifier">cooperative</span><span class="special">,</span>
- <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// throws boost::task::task_interrupted
+ <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// throws boost::task::task_interrupted
</span><span class="special">}</span>
</pre>
<p>
</p>
<a name="boost_task.task.exceptions"></a><h4>
-<a name="id568131"></a>
+<a name="id588622"></a>
<a class="link" href="task.html#boost_task.task.exceptions">Exceptions</a>
</h4>
<p>
@@ -187,10 +187,10 @@
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">void</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// get handle associated with the task
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">(),</span> <span class="comment">// asynchronous executor
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
-</span> <span class="identifier">throwing</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">wait</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// throws std::domain_error
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// task, to be executed asynchronously
+</span> <span class="identifier">throwing</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">new_thread</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// execution-policy
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">wait</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// throws std::domain_error
</span><span class="special">}</span>
</pre>
<p>
@@ -222,12 +222,12 @@
<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">broken_task</span></code></li>
</ul></div>
<a name="boost_task.task.parent_task"></a><h4>
-<a name="id568934"></a>
+<a name="id589426"></a>
<a class="link" href="task.html#boost_task.task.parent_task">Parent task</a>
</h4>
<p>
Top-level tasks have no parent. A parent task can create child tasks when it
- creates another task by using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span></code> as <span class="emphasis"><em>asynchronous-executor</em></span>.
+ creates another task by using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span></code> as <span class="emphasis"><em>execution-policy</em></span>.
These children are implicitly treated as <span class="emphasis"><em>sub-tasks</em></span> of
the larger task. It is assumed that that <span class="emphasis"><em>sub-tasks</em></span> can
be executed in any order because only overall operation speed matters (enabling
@@ -250,18 +250,18 @@
<span class="special">{</span>
<span class="comment">// submit a sub-task to pool calculating fibonacci(n-1)
</span> <span class="identifier">h1</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">(),</span> <span class="comment">// execute a sub-task
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">parallel_fib</span><span class="special">,</span>
<span class="identifier">n</span> <span class="special">-</span> <span class="number">1</span><span class="special">,</span>
<span class="identifier">cutof</span><span class="special">)</span> <span class="special">);</span>
+
<span class="comment">// submit a sub-task to pool calculating fibonacci(n-2)
</span> <span class="identifier">h2</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">as_sub_task</span><span class="special">(),</span> <span class="comment">// execute a sub-task
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
<span class="identifier">parallel_fib</span><span class="special">,</span>
<span class="identifier">n</span> <span class="special">-</span> <span class="number">2</span><span class="special">,</span>
<span class="identifier">cutof</span><span class="special">)</span> <span class="special">);</span>
+
<span class="comment">// calculate fibonacci(n) from the results of both sub-tasks
</span> <span class="keyword">return</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">();</span>
<span class="special">}</span>
@@ -269,21 +269,21 @@
<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// handle for fibonacci calculation
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h</span><span class="special">(</span> <span class="comment">// handle for fibonacci calculation
</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">(),</span> <span class="comment">// access the default thread-pool
-</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// calculate fibonacci number 10
-</span> <span class="identifier">parallel_fib</span><span class="special">,</span> <span class="comment">// for numbers < 5 do inline recursive calculation
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span> <span class="comment">// calculate fibonacci number 10
+</span> <span class="identifier">parallel_fib</span><span class="special">,</span> <span class="comment">// for numbers < 5 do inline recursive calculation
</span> <span class="number">10</span><span class="special">,</span>
- <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="number">5</span><span class="special">),</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">default_pool</span><span class="special">()</span> <span class="special">)</span> <span class="special">);</span> <span class="comment">// access the default thread-pool
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
</p>
<div class="footnotes">
<br><hr width="100" align="left">
-<div class="footnote"><p><sup>[<a name="ftn.id567065" href="#id567065" class="para">2</a>] </sup>
+<div class="footnote"><p><sup>[<a name="ftn.id587556" href="#id587556" class="para">2</a>] </sup>
see 'Interrupt Politely',
Herb Sutter
</p></div>
Modified: sandbox/task/libs/task/doc/html/boost_task/utilities.html
==============================================================================
--- sandbox/task/libs/task/doc/html/boost_task/utilities.html (original)
+++ sandbox/task/libs/task/doc/html/boost_task/utilities.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -33,7 +33,7 @@
runs in a <span class="emphasis"><em>thread-pool</em></span>).
</p>
<a name="boost_task.utilities.reschedule_until"></a><h4>
-<a name="id583403"></a>
+<a name="id606733"></a>
<a class="link" href="utilities.html#boost_task.utilities.reschedule_until">reschedule_until</a>
</h4>
<p>
@@ -44,7 +44,7 @@
until the passed predicate becomes true.
</p>
<a name="boost_task.utilities.get_pool"></a><h4>
-<a name="id583480"></a>
+<a name="id606810"></a>
<a class="link" href="utilities.html#boost_task.utilities.get_pool">get_pool</a>
</h4>
<p>
@@ -52,7 +52,7 @@
an assertion is raised.
</p>
<a name="boost_task.utilities.runs_in_pool"></a><h4>
-<a name="id583569"></a>
+<a name="id606898"></a>
<a class="link" href="utilities.html#boost_task.utilities.runs_in_pool">runs_in_pool</a>
</h4>
<p>
@@ -61,7 +61,7 @@
should be used.
</p>
<a name="boost_task.utilities.worker_id"></a><h4>
-<a name="id583628"></a>
+<a name="id606958"></a>
<a class="link" href="utilities.html#boost_task.utilities.worker_id">worker_id</a>
</h4>
<p>
@@ -70,7 +70,7 @@
executing the current <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span></code>.
</p>
<a name="boost_task.utilities.delay"></a><h4>
-<a name="id583744"></a>
+<a name="id607074"></a>
<a class="link" href="utilities.html#boost_task.utilities.delay">delay</a>
</h4>
<p>
@@ -78,7 +78,7 @@
can be delayed for a time-duration or until a specific time-point with <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span><span class="special">::</span><span class="identifier">delay</span><span class="special">()</span></code>.
</p>
<a name="boost_task.utilities.yield"></a><h4>
-<a name="id583828"></a>
+<a name="id607158"></a>
<a class="link" href="utilities.html#boost_task.utilities.yield">yield</a>
</h4>
<p>
@@ -88,7 +88,7 @@
the meantime.
</p>
<a name="boost_task.utilities.interrupt"></a><h4>
-<a name="id583945"></a>
+<a name="id607275"></a>
<a class="link" href="utilities.html#boost_task.utilities.interrupt">interrupt</a>
</h4>
<p>
Modified: sandbox/task/libs/task/doc/html/index.html
==============================================================================
--- sandbox/task/libs/task/doc/html/index.html (original)
+++ sandbox/task/libs/task/doc/html/index.html 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -27,7 +27,7 @@
</h3></div></div>
<div><p class="copyright">Copyright © 2009 Oliver Kowalke</p></div>
<div><div class="legalnotice" title="Legal Notice">
-<a name="id530548"></a><p>
+<a name="id549287"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
@@ -40,6 +40,7 @@
<dt><span class="section"> Motivation</span></dt>
<dt><span class="section"> Task</span></dt>
<dt><span class="section"> Handle</span></dt>
+<dt><span class="section"> Asynchronous execution</span></dt>
<dt><span class="section"> Execute in own thread</span></dt>
<dt><span class="section"> Execute in new thread</span></dt>
<dt><span class="section"> Thread-pool</span></dt>
@@ -60,11 +61,29 @@
<dd><dl>
<dt><span class="section"> Class template task
</span></dt>
<dt><span class="section"> Class template handle
</span></dt>
-<dt><span class="section"> Function async()
</span></dt>
+<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.async"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">EP</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.async1"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">pool</span><span class="special"><</span>
+ <span class="identifier">Channel</span> <span class="special">></span>
+ <span class="special">&)</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.async2"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special"><</span> <span class="identifier">R</span> <span class="special">>,</span>
+ <span class="identifier">Attr</span><span class="special">,</span> <span class="identifier">pool</span><span class="special"><</span> <span class="identifier">Channel</span> <span class="special">></span> <span class="special">&)</span></code></a></span></dt>
<dt><span class="section"> Class own_thread
</span></dt>
<dt><span class="section"> Class new_thread
</span></dt>
<dt><span class="section"> Class template static_pool
</span></dt>
-<dt><span class="section"> Utilities</span></dt>
+<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.reschedule_until"> Non-member function
+ <code class="computeroutput"><span class="identifier">reschedule_until</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.get_pool"> Non-member function
+ <code class="computeroutput"><span class="identifier">get_pool</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.runs_in_pool"> Non-member function
+ <code class="computeroutput"><span class="identifier">runs_in_pool</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.worker_id"> Non-member function
+ <code class="computeroutput"><span class="identifier">worker_id</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"> Non-member function delay()
</span></dt>
+<dt><span class="section"> Non-member function yield()
</span></dt>
+<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.interrupt"> Non-member function
+ <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a></span></dt>
<dt><span class="section"> Meta function has_attribute
</span></dt>
<dt><span class="section"><a href="boost_task/reference.html#boost_task.reference.attribute_type"> Meta function
<code class="computeroutput"><span class="identifier">attribute_type</span></code></a></span></dt>
@@ -145,14 +164,22 @@
</li>
</ul></div>
</li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">get_future</span><span class="special">()</span></code>
+ returns reference to internal future
+ </li>
+<li class="listitem">
+ functions <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">waitfor_all</span><span class="special">()</span></code>/<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">waitfor_any</span><span class="special">()</span></code>
+ to wait for all or any handles
+ </li>
</ul></div>
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">()</span></code>,
- executes a task on behalf of <span class="emphasis"><em>asynchronous-executors</em></span>
-</li>
+ executes a task on behalf of <span class="emphasis"><em>execution-policies</em></span> asynchronously
+ </li>
<li class="listitem">
-<span class="emphasis"><em>asynchronous-executor</em></span> models:
+<span class="emphasis"><em>execution-policy</em></span> models:
<div class="itemizedlist"><ul class="itemizedlist" type="circle">
<li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">own_thread</span></code>: executes task in current
@@ -173,14 +200,110 @@
</li>
<li class="listitem">
custom pool: task gets executed by a <span class="emphasis"><em>worker-thread</em></span>
- of a custom <span class="emphasis"><em>thread-pool</em></span>
+ of a custom <span class="emphasis"><em>thread-pool</em></span> (for instance with priority
+ scheduling)
+ </li>
+</ul></div>
</li>
+<li class="listitem">
+<span class="emphasis"><em>thread-pools</em></span> with work-stealing algorithm
+ </li>
+<li class="listitem">
+ support of forking and joining sub-tasks
+ <div class="itemizedlist"><ul class="itemizedlist" type="circle">
+<li class="listitem">
+ better performance
+ </li>
+<li class="listitem">
+ no deadlock because of inline-execution of sub-tasks
+ </li>
+<li class="listitem">
+ automatically detects if code runs in a <span class="emphasis"><em>thread-pool</em></span>
+ so the appropriate mechanism for executing the sub-tasks is choosen
+ </li>
</ul></div>
</li>
</ul></div>
<p>
- References
+ In order to use the classes and functions described here, you can either include
+ the specific headers specified by the descriptions of each class or function,
+ or include the master library header:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre>
+<p>
+ </p>
+<p>
+ which includes all the other headers in turn.
+ </p>
+<p>
+ Used namespaces are:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span>
+<span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span>
+</pre>
+<p>
</p>
+<a name="boost_task.overview.example"></a><h4>
+<a name="id582635"></a>
+ <a class="link" href="index.html#boost_task.overview.example">Example</a>
+ </h4>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">fibonacci</span><span class="special">(</span> <span class="keyword">long</span> <span class="identifier">n</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">n</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span> <span class="identifier">n</span> <span class="special">==</span> <span class="number">1</span><span class="special">)</span> <span class="keyword">return</span> <span class="number">1</span><span class="special">;</span>
+ <span class="keyword">long</span> <span class="identifier">k1</span><span class="special">(</span> <span class="number">1</span><span class="special">),</span> <span class="identifier">k2</span><span class="special">(</span> <span class="number">0</span><span class="special">);</span>
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">(</span> <span class="number">2</span><span class="special">);</span> <span class="identifier">i</span> <span class="special"><=</span> <span class="identifier">n</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">long</span> <span class="identifier">tmp</span><span class="special">(</span> <span class="identifier">k1</span><span class="special">);</span>
+ <span class="identifier">k1</span> <span class="special">=</span> <span class="identifier">k1</span> <span class="special">+</span> <span class="identifier">k2</span><span class="special">;</span>
+ <span class="identifier">k2</span> <span class="special">=</span> <span class="identifier">tmp</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="identifier">k1</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h1</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
+ <span class="identifier">fibonacci</span><span class="special">,</span>
+ <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special"><</span> <span class="keyword">long</span> <span class="special">></span> <span class="identifier">h2</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">async</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">make_task</span><span class="special">(</span>
+ <span class="identifier">fibonacci</span><span class="special">,</span>
+ <span class="number">5</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h1: id == "</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get_id</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h2: id == "</span> <span class="special"><<</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get_id</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h1: is ready == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h2: is ready == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">h1</span><span class="special">,</span> <span class="identifier">h2</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h1: is ready == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h2: is ready == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h1: has value == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">has_value</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h2: has value == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">has_value</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h1: has exception == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">has_exception</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"h2: has exception == "</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special"><<</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">has_exception</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"\n"</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(10) == "</span> <span class="special"><<</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"fibonacci(5) == "</span> <span class="special"><<</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.overview.references"></a><h4>
+<a name="id584217"></a>
+ <a class="link" href="index.html#boost_task.overview.references">References</a>
+ </h4>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
N2185: Proposed Text for Parallel Task Execution http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2185.html
@@ -195,6 +318,10 @@
written by Hans-J. Boehm.
</li>
<li class="listitem">
+ N2880: C++ object lifetime interactions with the threads API http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html
+ written by Hans-J. Boehm and Lawrence Crowl.
+ </li>
+<li class="listitem">
<a href="http://herbsutter.wordpress.com" target="_top">'Sutter’s Mill'</a> by
Herb Sutter
</li>
@@ -212,18 +339,8 @@
integrated in some of the next releases of Boost.Thread).
</p></td></tr>
</table></div>
-<p>
- In order to use the classes and functions described here, you can either include
- the specific headers specified by the descriptions of each class or function,
- or include the master library header:
- </p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-</pre>
-<p>
- which includes all the other headers in turn.
- </p>
<a name="boost_task.overview.tested_platforms"></a><h4>
-<a name="id563818"></a>
+<a name="id584318"></a>
<a class="link" href="index.html#boost_task.overview.tested_platforms">Tested Platforms</a>
</h4>
<p>
@@ -241,20 +358,18 @@
FreeBSD 7.2 (x86), GCC 4.2.1
</li>
<li class="listitem">
- OpenSolaris 0811 (x86_64), SunCC 5.10
- </li>
-<li class="listitem">
Windows XP Professional (x86), MSVC 9.0
</li>
</ul></div>
<a name="boost_task.overview.how_to_build"></a><h4>
-<a name="id563862"></a>
+<a name="id584359"></a>
<a class="link" href="index.html#boost_task.overview.how_to_build">How to build</a>
</h4>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
download the sources form boost-vault
- (section <span class="emphasis"><em>Concurrent Programing</em></span>) or boost-sandbox
+ (section <span class="emphasis"><em>Concurrent Programing</em></span>) or the latest development
+ version from boost-sandbox
</li>
<li class="listitem">
extract the archive into the boost-source directory
@@ -269,7 +384,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: June 01, 2009 at 12:11:54 GMT</small></p></td>
+<td align="left"><p><small>Last revised: June 08, 2009 at 19:40:04 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox/task/libs/task/doc/introduction.qbk
==============================================================================
--- sandbox/task/libs/task/doc/introduction.qbk (original)
+++ sandbox/task/libs/task/doc/introduction.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -9,7 +9,7 @@
[section:motivation Motivation]
To speed-up computer-bound work and/or increase the computation-throughput is a common motivation for parallelizing a program.
-Especially for interactive applications that have to process user input while performing some background tasks responsivness iss
+Especially for interactive applications that have to process user input while performing some background tasks responsivness is
very important.
Parallelizing a program requires partitioning the program into smaller chunks that can run in parallel. The code can scale as the
hardware gets better without changing the code.
@@ -23,7 +23,7 @@
__boost_task__ provides a framework to utilize the available hardware and provide a way for efficient asynchronous processing of
time consuming operations.
-The framework provides some __aes__, like __new_thread__, in order to execute the task asynchronously in another execution
+The framework provides some __eps__, like __new_thread__, in order to execute the task asynchronously in another execution
context (__boost_task__ uses preemptible threads for this purpose).
``
@@ -33,10 +33,10 @@
void main()
{
boost::task::async( // dispatchs task
- boost::task::new_thread(), // asynchronous executor
boost::task::make_task( // task, to be executed asynchronously
print,
- "Hello World!") ) );
+ "Hello World!"),
+ boost::task::new_thread() ) ); // execution-policy
}
``
@@ -51,10 +51,10 @@
{
boost::task::handle< std::string > h( // get handle associated with the task
boost::task::async(
- boost::task::new_thread(), // asynchronous executor
boost::task::make_task( // task, to be executed asynchronously
echo,
- "Hello World!") ) );
+ "Hello World!"),
+ boost::task::new_thread() ) ); // execution-policy
std::cout << h.get() << std::endl; // wait until task is finished and return the result
}
``
@@ -68,11 +68,11 @@
void main()
{
boost::task::handle< std::string > h( // get handle associated with the task
- boost::task::async(
- boost::task::new_thread(), // asynchronous executor
+ boost::task::async(
boost::task::make_task( // long runing task, to be executed asynchronously
long_running,
- boost::posix_time::millisec( 500) ) ) );
+ boost::posix_time::millisec( 500) ),
+ boost::task::new_thread() ) ); // execution-policy
h.interrupt(); // interrupt execution of task
std::cout << h.get() << std::endl; // wait until task is finished, will throw an exeception
}
@@ -96,18 +96,20 @@
{
// fork a sub-task calculating fibonacci(n-1)
h1 = boost::task::async(
- boost::this_task::get_pool(),
boost::task::make_task(
parallel_fib,
n - 1,
- cutof) );
+ cutof),
+ boost::this_task::get_pool() );
+
// fork a sub-task calculating fibonacci(n-2)
h2 = boost::task::async(
- boost::this_task::get_pool(),
boost::task::make_task(
parallel_fib,
n - 2,
- cutof) );
+ cutof),
+ boost::this_task::get_pool() );
+
// join the results of both sub-tasks
return h1.get() + h2.get();
}
@@ -115,13 +117,13 @@
void main()
{
- boost::task::handle< long > h( // handle for fibonacci calculation
+ boost::task::handle< long > h( // handle for fibonacci calculation
boost::task::async(
- boost::task::default_pool(), // access the default thread-pool
- boost::task::make_task( // calculate fibonacci number 10
- parallel_fib, // for numbers < 5 do inline recursive calculation
+ boost::task::make_task( // calculate fibonacci number 10
+ parallel_fib, // for numbers < 5 do inline recursive calculation
10,
- 5) ) );
+ 5),
+ boost::task::default_pool() ) ); // access the default thread-pool
std::cout << h.get() << std::endl;
}
``
@@ -133,11 +135,11 @@
``
boost::task::async(
- boost::task::as_sub_task(), // sub-task executed in a new thread or inside
boost::task::make_task( // the thread-pool depending upon the parent
parallel_fib, // task is executed inside a thread-pool or not
10,
- 5) ) );
+ 5),
+ boost::task::as_sub_task() ) ); // sub-task executed in a new thread or inside
``
[endsect]
Modified: sandbox/task/libs/task/doc/new_thread.qbk
==============================================================================
--- sandbox/task/libs/task/doc/new_thread.qbk (original)
+++ sandbox/task/libs/task/doc/new_thread.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -13,9 +13,6 @@
The returned __handle__ joins the thread in its destructor (if the last reference gets out of scope) and thus provides one possible
solution of [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html N2880].
-[caution Always store the returned __act__ in a variable because __handle__ joins the thread in its destructor (if the last
-reference gets out of scope). ]
-
``
@@ -37,28 +34,29 @@
{
boost::task::handle< long > h(
boost::task::async(
- boost::task::new_thread(),
boost::task::make_task(
fibonacci,
- 10) ) );
+ 10),
+ boost::task::new_thread() ) );
std::cout << "fibonacci(10) == " << h.get() << std::endl;
}
``
+[caution Always store the returned __act__ in a variable because __handle__ joins the thread in its destructor (if the last
+reference gets out of scope). ]
+
In the example below both `a_function()` and `another_function()` are executed synchron (see [link_own_thread __own_thread__]
for synchronous execution)!
``
- boost::task::async(
- boost::task::new_thread(),
- boost::task::make_task(
- a_function) ) );
+ boost::task::async(
+ boost::task::make_task( a_function),
+ boost::task::new_thread() ) );
- boost::task::async(
- boost::task::new_thread(),
- boost::task::make_task(
- another_function) ) );
+ boost::task::async(
+ boost::task::make_task( another_function),
+ boost::task::new_thread() ) );
``
[endsect]
Modified: sandbox/task/libs/task/doc/overview.qbk
==============================================================================
--- sandbox/task/libs/task/doc/overview.qbk (original)
+++ sandbox/task/libs/task/doc/overview.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -22,15 +22,19 @@
* __fn_get__ retrieve value or exception of task execution
* __fn_is_ready__ test if task was executed
* __fn_wait__, __fn_wait_for__ and __fn_wait_until__ block until task is executed and the result is set
+ * __fn_get_future__ returns reference to internal future
+ * functions __waitfor_all__/__waitfor_any__ to wait for all or any handles
-* __fn_async__, executes a task on behalf of __aes__
+* __fn_async__, executes a task on behalf of __eps__ asynchronously
-* __ae__ models:
+* __ep__ models:
* __own_thread__: executes task in current thread.
* __new_thread__: executes task in a newly created thread (thread will be destroyed after)
* __default_pool__: task gets executed by a __worker_thread__ of the default __thread_pool__
* __as_sub_task__: executes task in newly created thread or in a pool of __worker_threads__ depending on whether current task is already executed in a pool
- * custom pool: task gets executed by a __worker_thread__ of a custom __thread_pool__
+ * custom pool: task gets executed by a __worker_thread__ of a custom __thread_pool__ (for instance with priority scheduling)
+
+* __thread_pools__ with work-stealing algorithm
* support of forking and joining sub-tasks
* better performance
@@ -38,22 +42,6 @@
* automatically detects if code runs in a __thread_pool__ so the appropriate mechanism for executing the sub-tasks is choosen
-References
-
-* N2185: Proposed Text for Parallel Task Execution [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2185.html] written by Peter Dimov.
-
-* N2276: Thread Pools and Futures [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2276.html] written by Anthony Williams.
-
-* N2802: A plea to reconsider detach-on-destruction for thread objects [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2802.html] written by Hans-J. Boehm.
-
-* N2880: C++ object lifetime interactions with the threads API [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html] written by Hans-J. Boehm and Lawrence Crowl.
-
-* [@http://herbsutter.wordpress.com 'Sutterâs Mill'] by Herb Sutter
-
-* mailing list of C++ standard committee's Library Working Group
-
-[note __boost_task__ uses __boost_future__ from Anthony Williams (will be integrated in some of the next releases of __boost_thread__).]
-
In order to use the classes and functions described here, you can either include the specific headers specified by the descriptions of each class or function,
or include the master library header:
@@ -70,6 +58,70 @@
namespace boost::this_task
``
+
+[heading Example]
+
+``
+ long fibonacci( long n)
+ {
+ if ( n == 0) return 0;
+ if ( n == 1) return 1;
+ long k1( 1), k2( 0);
+ for ( int i( 2); i <= n; ++i)
+ {
+ long tmp( k1);
+ k1 = k1 + k2;
+ k2 = tmp;
+ }
+ return k1;
+ }
+
+ void main()
+ {
+ boost::task::handle< long > h1(
+ boost::task::async(
+ boost::task::make_task(
+ fibonacci,
+ 10) ) );
+ boost::task::handle< long > h2(
+ boost::task::async(
+ boost::task::make_task(
+ fibonacci,
+ 5) ) );
+ std::cout << "h1: id == " << h1.get_id() << "\n";
+ std::cout << "h2: id == " << h2.get_id() << "\n";
+ std::cout << "h1: is ready == " << std::boolalpha << h1.is_ready() << "\n";
+ std::cout << "h2: is ready == " << std::boolalpha << h2.is_ready() << "\n";
+ boost::task::waitfor_all( h1, h2);
+ std::cout << "h1: is ready == " << std::boolalpha << h1.is_ready() << "\n";
+ std::cout << "h2: is ready == " << std::boolalpha << h2.is_ready() << "\n";
+ std::cout << "h1: has value == " << std::boolalpha << h1.has_value() << "\n";
+ std::cout << "h2: has value == " << std::boolalpha << h2.has_value() << "\n";
+ std::cout << "h1: has exception == " << std::boolalpha << h1.has_exception() << "\n";
+ std::cout << "h2: has exception == " << std::boolalpha << h2.has_exception() << "\n";
+ std::cout << "fibonacci(10) == " << h1.get() << std::endl;
+ std::cout << "fibonacci(5) == " << h2.get() << std::endl;
+ }
+``
+
+
+[heading References]
+
+* N2185: Proposed Text for Parallel Task Execution [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2185.html] written by Peter Dimov.
+
+* N2276: Thread Pools and Futures [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2276.html] written by Anthony Williams.
+
+* N2802: A plea to reconsider detach-on-destruction for thread objects [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2802.html] written by Hans-J. Boehm.
+
+* N2880: C++ object lifetime interactions with the threads API [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2880.html] written by Hans-J. Boehm and Lawrence Crowl.
+
+* [@http://herbsutter.wordpress.com 'Sutterâs Mill'] by Herb Sutter
+
+* mailing list of C++ standard committee's Library Working Group
+
+[note __boost_task__ uses __boost_future__ from Anthony Williams (will be integrated in some of the next releases of __boost_thread__).]
+
+
[heading Tested Platforms]
__boost_task__ has been tested on the following platforms and compilers:
@@ -83,7 +135,7 @@
[heading How to build]
-* download the sources form [@http://www.boostpro.com/vault/index.php boost-vault] (section ['Concurrent Programing]) or
+* download the sources form [@http://www.boostpro.com/vault/index.php boost-vault] (section ['Concurrent Programing]) or the latest development version from
[@https://svn.boost.org/svn/boost/sandbox/task/ boost-sandbox]
* extract the archive into the boost-source directory
* change directory to <boost-source>/libs/task/build
Modified: sandbox/task/libs/task/doc/own_thread.qbk
==============================================================================
--- sandbox/task/libs/task/doc/own_thread.qbk (original)
+++ sandbox/task/libs/task/doc/own_thread.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -29,10 +29,10 @@
{
boost::task::handle< long > h(
boost::task::async(
- boost::task::own_thread(),
boost::task::make_task(
fibonacci,
- 10) ) );
+ 10),
+ boost::task::own_thread() ) );
std::cout << "fibonacci(10) == " << h.get() << std::endl;
}
``
Modified: sandbox/task/libs/task/doc/pool.qbk
==============================================================================
--- sandbox/task/libs/task/doc/pool.qbk (original)
+++ sandbox/task/libs/task/doc/pool.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -25,10 +25,10 @@
{
boost::task::handle< std::string > h(
boost::task::async(
- boost::task::default_pool(),
boost::task::make_task(
echo,
- "Hello World!") ) );
+ "Hello World!"),
+ boost::task::default_pool() ) );
std::cout << h.get() << std::endl;
}
``
@@ -50,14 +50,13 @@
{
boost::task::handle< std::string > h(
boost::task::async(
- pool,
boost::task::make_task(
echo,
- "Hello World!") ) );
+ "Hello World!"),
+ pool) );
std::cout << h.get() << std::endl;
}
``
-.
[important Tasks should not be too small (performance overhead dominates) and avoid blocking
tasks[footnote see [@http://www.ddj.com/go-parallel/article/showArticle.jhtml?articleID=216500409
Modified: sandbox/task/libs/task/doc/ref_async.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_async.qbk (original)
+++ sandbox/task/libs/task/doc/ref_async.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -6,54 +6,52 @@
]
-[section:async Function `async()`]
-
-[section:async_default Templated non-member function `async( AE, task< R >)`]
+[section:async Non-member function `async( task< R >, EP)`]
``
#include <boost/task/async.hpp>
- template< typename AE, typename R >
- handle< R > async( AE ae, task< R > t);
+ template< typename R, typename EP >
+ handle< R > async( task< R > t, EP ep);
``
[variablelist
[[Effects:] [executes task in an asyncrounous executer and returns a handle associated with the task]]
[[Throws:] [Nothing]]
]
+
[endsect]
-[section:async_pool Templated non-member function `async( pool< Channel > &, task< R >)`]
+[section:async1 Non-member function `async( task< R >, pool< Channel > &)`]
``
#include <boost/task/async.hpp>
template< typename R, typename Channel >
- handle< R > async( pool< Channel > & ae, task< R > t);
+ handle< R > async( task< R > t, pool< Channel > & ep);
``
[variablelist
[[Effects:] [executes task in a thread-pool and returns a handle associated with the task]]
[[Throws:] [Nothing]]
]
+
[endsect]
-[section:async_pool_attr Templated non-member function `async( pool< Channel > &, task< R >, Attr)`]
+[section:async2 Non-member function `async( task< R >, Attr, pool< Channel > &)`]
``
#include <boost/task/async.hpp>
template< typename R, typename Channel, typename Attr >
- handle< R > async( pool< Channel > & ae, task< R > t, Attr attr);
+ handle< R > async( task< R > t, Attr attr, pool< Channel > & ep);
``
[variablelist
[[Effects:] [executes atrributed task in a thread-pool and returns a handle associated with the task]]
[[Throws:] [Nothing]]
]
-[endsect]
-
[endsect]
Modified: sandbox/task/libs/task/doc/ref_exceptions.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_exceptions.qbk (original)
+++ sandbox/task/libs/task/doc/ref_exceptions.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -18,7 +18,7 @@
};
``
-[section:constructor Constructor]
+[heading Constructor]
invalid_poolsize( std::string const& msg);
@@ -26,7 +26,6 @@
[[Effects:] [Constructs a `boost::task::invalid_poolsize` instance.]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
@@ -43,7 +42,7 @@
};
``
-[section:constructor Constructor]
+heading Constructor]
invalid_scanns( std::string const& msg)
@@ -51,7 +50,6 @@
[[Effects:] [Constructs a `boost::task::invalid_scanns` instance.]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
@@ -68,7 +66,7 @@
};
``
-[section:constructor Constructor]
+[heading Constructor]
invalid_timeduration( std::string const& msg)
@@ -76,7 +74,6 @@
[[Effects:] [Constructs a `boost::task::invalid_timeduration` instance.]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
@@ -93,7 +90,7 @@
};
``
-[section:constructor Constructor]
+[heading Constructor]
invalid_watermark( std::string const& msg)
@@ -101,7 +98,6 @@
[[Effects:] [Constructs a `boost::task::invalid_watermark` instance.]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
@@ -118,7 +114,7 @@
};
``
-[section:constructor Constructor]
+[heading Constructor]
task_rejected( std::string const& msg)
@@ -126,7 +122,6 @@
[[Effects:] [Constructs a `boost::task::task_rejected` instance.]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
Modified: sandbox/task/libs/task/doc/ref_handle.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_handle.qbk (original)
+++ sandbox/task/libs/task/doc/ref_handle.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -42,9 +42,39 @@
void swap( handle< R > & other);
};
+
+ template< typename Iterator >
+ friend void waitfor_all( Iterator begin, Iterator end);
+
+ template< typename T1, typename T2 >
+ friend void waitfor_all( T1 & t1, T2 & t2);
+
+ template< typename T1, typename T2, typename T3 >
+ friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3);
+
+ template< typename T1, typename T2, typename T3, typename T4 >
+ friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4);
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5);
+
+ template< typename Iterator >
+ friend Iterator waitfor_any( Iterator begin, Iterator end);
+
+ template< typename T1, typename T2 >
+ friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2);
+
+ template< typename T1, typename T2, typename T3 >
+ friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3);
+
+ template< typename T1, typename T2, typename T3, typename T4 >
+ friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4);
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5);
``
-[section:constructor Constructor]
+[heading Constructor]
handle()
@@ -52,10 +82,9 @@
[[Effects:] [constructs an empty (invalid) handle]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:get_id Member function `get_id()`]
+[heading Member function `get_id()`]
const id get_id() const
@@ -63,10 +92,9 @@
[[Effects:] [returns identifier of the associated task]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:interruption_requested Member function `interruption_requested()`]
+[heading Member function `interruption_requested()`]
bool interruption_requested()
@@ -74,10 +102,9 @@
[[Effects:] [checks if interruption is already requested]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:interrupt Member function `interrupt()`]
+[heading Member function `interrupt()`]
void interrupt()
@@ -85,10 +112,9 @@
[[Effects:] [requests task interruption; doesn not block (immediatly returns)]]
[[Throws:] [???]]
]
-[endsect]
-[section:interrupt_and_wait Member function `interrupt_and_wait()`]
+[heading Member function `interrupt_and_wait()`]
void interrupt_and_wait()
@@ -96,10 +122,9 @@
[[Effects:] [requests task interruption and blocks until worker-thread stops task]]
[[Throws:] [???]]
]
-[endsect]
-[section:interrupt_and_wait_until Member function `interrupt_and_wait_until()`]
+[heading Member function `interrupt_and_wait_until()`]
void interrupt_and_wait_until( system_time const& abs_time)
@@ -107,10 +132,9 @@
[[Effects:] [requests task interruption and blocks until worker-thread stops task or time-point elapsed]]
[[Throws:] [???]]
]
-[endsect]
-[section:interrupt_and_wait_for Member function `interrupt_and_wait_for()`]
+[heading Member function `interrupt_and_wait_for()`]
template< typename Duration >
void interrupt_and_wait_for( Duration const& rel_time)
@@ -119,10 +143,9 @@
[[Effects:] [requests task interruption and blocks until worker-thread stops task or time-duration elapsed]]
[[Throws:] [???]]
]
-[endsect]
-[section:get Member function `get()`]
+[heading Member function `get()`]
R get()
@@ -130,10 +153,9 @@
[[Effects:] [requests the result]]
[[Throws:] [task_interrupted, task_uninialized]]
]
-[endsect]
-[section:wait Member function `wait()`]
+[heading Member function `wait()`]
void wait()
@@ -141,10 +163,9 @@
[[Effects:] [blocks caller until task is done]]
[[Throws:] [task_interrupted, task_uninialized]]
]
-[endsect]
-[section:is_ready Member function `is_ready()`]
+[heading Member function `is_ready()`]
bool is_ready()
@@ -152,10 +173,9 @@
[[Effects:] [checks if task is done]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:has_value Member function `has_value()`]
+[heading Member function `has_value()`]
bool has_value()
@@ -163,10 +183,9 @@
[[Effects:] [checks if task is done and a result value is set]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:has_exception Member function `has_exception()`]
+[heading Member function `has_exception()`]
bool has_exception()
@@ -174,10 +193,9 @@
[[Effects:] [checks if task is done and an exception is set]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:get_future Member function `get_future()`]
+[heading Member function `get_future()`]
shared_future< R > & get_future()
@@ -185,10 +203,9 @@
[[Effects:] [returns a reference to the internal shared_future< R >]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:swap Member function `swap()`]
+[heading Member function `swap()`]
void swap( handle< R > & other)
@@ -196,7 +213,52 @@
[[Effects:] [swapps handle]]
[[Throws:] [Nothing]]
]
-[endsect]
+
+
+[heading Non-member function `wait_for_all()`]
+
+ template< typename Iterator >
+ friend void waitfor_all( Iterator begin, Iterator end);
+
+ template< typename T1, typename T2 >
+ friend void waitfor_all( T1 & t1, T2 & t2);
+
+ template< typename T1, typename T2, typename T3 >
+ friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3);
+
+ template< typename T1, typename T2, typename T3, typename T4 >
+ friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4);
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ friend void waitfor_all( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5);
+
+[variablelist
+[[Effects:] [waits for all handles to become ready]]
+[[Throws:] [Nothing]]
+]
+
+
+[heading Non-member function `wait_for_any()`]
+
+ template< typename Iterator >
+ friend Iterator waitfor_any( Iterator begin, Iterator end);
+
+ template< typename T1, typename T2 >
+ friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2);
+
+ template< typename T1, typename T2, typename T3 >
+ friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3);
+
+ template< typename T1, typename T2, typename T3, typename T4 >
+ friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4);
+
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ friend unsigned int waitfor_any( handle< T1 > & t1, handle< T2 > & t2, handle< T3 > & t3, handle< T4 > & t4, handle< T5 > & t5);
+
+[variablelist
+[[Effects:] [waits for any handle to become ready]]
+[[Throws:] [Nothing]]
+]
[endsect]
Modified: sandbox/task/libs/task/doc/ref_new_thread.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_new_thread.qbk (original)
+++ sandbox/task/libs/task/doc/ref_new_thread.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -18,7 +18,7 @@
};
``
-[section:operator Member function `operator()( task< R > t)`]
+[heading Member function `operator()( task< R > t)`]
template< typename R >
handle< R > operator()( task< R > t)
@@ -27,7 +27,6 @@
[[Effects:] [executes task in a new thread an returns an handle associated with the task]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
\ No newline at end of file
Modified: sandbox/task/libs/task/doc/ref_own_thread.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_own_thread.qbk (original)
+++ sandbox/task/libs/task/doc/ref_own_thread.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -18,7 +18,7 @@
};
``
-[section:operator Member function `operator()( task< R > t)`]
+[heading Member function `operator()( task< R > t)`]
template< typename R >
handle< R > operator()( task< R > t)
@@ -27,7 +27,6 @@
[[Effects:] [executes task in the current thread an returns an handle associated with the task]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
\ No newline at end of file
Modified: sandbox/task/libs/task/doc/ref_poolsize.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_poolsize.qbk (original)
+++ sandbox/task/libs/task/doc/ref_poolsize.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -20,7 +20,7 @@
};
``
-[section:constructor Constructor]
+[heading Constructor]
explicit poolsize( std::size_t value)
@@ -30,10 +30,9 @@
[[Postconditions:][operator std::size_t () > 0]]
[[Throws:] [`boost::task::invalid_poolsize`]]
]
-[endsect]
-[section:operator Member function `operator std::size_t()`]
+[heading Member function `operator std::size_t()`]
operator std::size_t () const
@@ -41,6 +40,6 @@
[[Effects:] [returns the value]]
[[Throws:] [Nothing]]
]
-[endsect]
+
[endsect]
Modified: sandbox/task/libs/task/doc/ref_scanns.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_scanns.qbk (original)
+++ sandbox/task/libs/task/doc/ref_scanns.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -20,7 +20,7 @@
};
``
-[section:constructor Constructor]
+[heading Constructor]
explicit scanns( std::size_t value)
@@ -30,10 +30,9 @@
[[Postconditions:][operator std::size_t () > 0]]
[[Throws:] [`boost::task::invalid_poolsize`]]
]
-[endsect]
-[section:operator Member function `operator std::size_t()`]
+[heading Member function `operator std::size_t()`]
operator std::size_t () const
@@ -41,6 +40,6 @@
[[Effects:] [returns the value]]
[[Throws:] [Nothing]]
]
-[endsect]
+
[endsect]
Modified: sandbox/task/libs/task/doc/ref_stacksize.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_stacksize.qbk (original)
+++ sandbox/task/libs/task/doc/ref_stacksize.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -17,7 +17,7 @@
operator std::size_t () const;
};
-[section:constructor Constructor]
+[heading Constructor]
explicit stacksize( std::size_t value);
@@ -27,9 +27,8 @@
[[Postconditions:][operator std::size_t () > 0]]
[[Throws:] [`boost::tp::invalid_stacksize`]]
]
-[endsect]
-[section:operator Member function `operator std::size_t()`]
+[heading Member function `operator std::size_t()`]
operator std::size_t () const;
@@ -37,6 +36,6 @@
[[Effects:] [Returns stack size.]]
[[Throws:] [Nothing]]
]
-[endsect]
+
[endsect]
Modified: sandbox/task/libs/task/doc/ref_static_pool.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_static_pool.qbk (original)
+++ sandbox/task/libs/task/doc/ref_static_pool.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -65,7 +65,7 @@
};
``
-[section:constructor_unbounded_channel_hw Constructor (unbounded channel)]
+[heading Constructor (unbounded channel)]
explicit static_pool(
posix_time::time_duration const& asleep = posix_time::microseconds( 10),
@@ -77,10 +77,9 @@
[[Throws:] [`boost::task::invalid_scanns`, `boost::task::invalid_timeduration`]]
[[Notes:] [constructor has to be called if a unbounded-channel is used]]
]
-[endsect]
-[section:constructor_unbounded_channel Constructor (unbounded channel)]
+[heading Constructor (unbounded channel/poolsize)]
explicit static_pool(
poolsize const& psize,
@@ -92,10 +91,9 @@
[[Throws:] [`boost::task::invalid_scanns`, `boost::task::invalid_timeduration`]]
[[Notes:] [constructor has to be called if a unbounded-channel is used]]
]
-[endsect]
-[section:constructor_bounded_channel_hw Constructor (bounded channel)]
+[heading Constructor (bounded channel)]
explicit static_pool(
high_watermark const& hwm,
@@ -109,10 +107,9 @@
[[Throws:] [`boost::task::invalid_scanns`, `boost::task::invalid_timeduration`, `boost::task::invalid_watermark`]]
[[Notes:] [Constructor has to be called if a bounded-channel is used.]]
]
-[endsect]
-[section:constructor_bounded_channel Constructor (bounded channel)]
+[heading Constructor (bounded channel/poolsize)]
explicit static_pool(
poolsize const& psize,
@@ -126,10 +123,9 @@
[[Throws:] [`boost::task::invalid_scanns`, `boost::task::invalid_timeduration`, `boost::task::invalid_watermark`]]
[[Notes:] [constructor has to be called if a bounded-channel is used]]
]
-[endsect]
-[section:destructor Destructor]
+[heading Destructor]
~static_pool()
@@ -137,10 +133,9 @@
[[Effects:] [calls `:shutdown()` if not already called]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:size Member function `size()`]
+[heading Member function `size()`]
std::size_t size()
@@ -148,10 +143,9 @@
[[Effects:] [returns how many worker-threads are running in the pool]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:active Member function `active()`]
+[heading Member function `active()`]
std::size_t active()
@@ -159,10 +153,9 @@
[[Effects:] [returns how many worker-threads are active (executing an task)]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:idle Member function `idle()`]
+[heading Member function `idle()`]
std::size_t idle()
@@ -171,10 +164,9 @@
[[Throws:] [Nothing]]
[[Notes:] [The value is the difference of `size()` and `active()`]]
]
-[endsect]
-[section:shutdown Member function `shutdown()`]
+[heading Member function `shutdown()`]
void shutdown()
@@ -183,10 +175,9 @@
[[Throws:] [Nothing]]
[[Notes:] [all pending tasks are processed]]
]
-[endsect]
-[section:shutdown_now Member function `shutdown_now()`]
+[heading Member function `shutdown_now()`]
void shutdown_now()
@@ -195,10 +186,9 @@
[[Throws:] [Nothing]]
[[Notes:] [pending tasks are not processed but returned]]
]
-[endsect]
-[section:losed Member function `closed()`]
+[heading Member function `closed()`]
bool closed()
@@ -206,10 +196,9 @@
[[Effects:] [queries if the pool is closed (pool is shutdown)]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:clear Member function `clear()`]
+[heading Member function `clear()`]
void clear()
@@ -217,10 +206,9 @@
[[Effects:] [removes all pending tasks from the channel]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:empty Member function `empty()`]
+[heading Member function `empty()`]
bool empty()
@@ -228,10 +216,9 @@
[[Effects:] [queries if the channel is empty]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:pending Member function `pending()`]
+[heading Member function `pending()`]
std::size_t pending()
@@ -239,10 +226,9 @@
[[Effects:] [queries how many tasks are pending (still unprocessed) in the global-queue (channel)]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:get_upper_bound Member function `upper_bound()`]
+[heading Member function `upper_bound()`]
std::size_t upper_bound()
@@ -252,10 +238,9 @@
[[Throws:] [Nothing]]
[[Notes:] [can only be used if a bounded-channel is used]]
]
-[endsect]
-[section:set_upper_bound Member function `upper_bound( high_watermark const& hwm)`]
+[heading Member function `upper_bound( high_watermark const& hwm)`]
void upper_bound( high_watermark const& hwm)
@@ -266,10 +251,9 @@
[[Throws:] [`boost::task::invalid_watermark`]]
[[Notes:] [can only be used if a bounded-channel is used]]
]
-[endsect]
-[section:get_lower_bound Member function `lower_bound()`]
+[heading Member function `lower_bound()`]
std::size_t lower_bound();
@@ -279,10 +263,9 @@
[[Throws:] [Nothing]]
[[Notes:] [can only be used if a bounded-channel is used]]
]
-[endsect]
-[section:set_lower_bound Member function `lower_bound( low_watermark const& lwm)`]
+[heading Member function `lower_bound( low_watermark const& lwm)`]
void lower_bound( low_watermark const& lwm)
@@ -293,10 +276,9 @@
[[Throws:] [`boost::task::invalid_watermark`]]
[[Notes:] [can only be used if a bounded-channel is used]]
]
-[endsect]
-[section:submit Member function `submit( Act const& act)`]
+[heading Member function `submit( Act const& act)`]
template< typename R >
handle< R > submit( task< R > const& t)
@@ -306,10 +288,9 @@
[[Effects:] [submits an task to the pool and returns an associated handle]]
[[Throws:] [`boost::task::task_rejected`]]
]
-[endsect]
-[section:submit_attr Member function `submit( Act const& act, Attr const& attr)`]
+[heading Member function `submit( Act const& act, Attr const& attr)`]
template< typename R, typename Attr >
handle< R > submit( task< R > const& t, Attr const& attr)
@@ -319,7 +300,6 @@
[[Effects:] [submits an task to the pool and returns an associated handle - task is scheduled by the attribute]]
[[Throws:] [`boost::task::task_rejected`]]
]
-[endsect]
[endsect]
Modified: sandbox/task/libs/task/doc/ref_task.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_task.qbk (original)
+++ sandbox/task/libs/task/doc/ref_task.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -24,10 +24,18 @@
void swap( task< R > & other) // throw();
void operator()() // throw();
- }
+ };
+
+ template< typename Fn, typename A0 >
+ task< R >::type > make_task( Fn fn, A0 a0);
+
+ ...
+
+ template< typename Fn, typename A0, ..., typename A10 >
+ task< R >::type > make_task( Fn fn, A0 a0, ..., A10 a10);
``
-[section:constructor Constructor]
+[heading Constructor]
template< typename Fn >
task( Fn const& fn)
@@ -36,10 +44,9 @@
[[Effects:] [constructs a `boost::tp::task< R >` from a function object]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:get_id Member function `get_id()`]
+[heading function `get_id()`]
const id get_id() const
@@ -47,10 +54,9 @@
[[Effects:] [returns task identifier]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:get_future Member function `get_future()`]
+[heading Member function `get_future()`]
shared_future< R > & get_future()
@@ -58,10 +64,9 @@
[[Effects:] [returns a future assiciated with the task]]
[[Throws:] [???]]
]
-[endsect]
-[section:swap Member function `swap()`]
+[heading Member function `swap()`]
void swap( task< R > & other)
@@ -69,10 +74,9 @@
[[Effects:] [swaps the task]]
[[Throws:] [Nothing]]
]
-[endsect]
-[section:operator Member function `operator()()`]
+[heading Member function `operator()()`]
void operator()()
@@ -80,7 +84,22 @@
[[Effects:] [executes tasks internal function object]]
[[Throws:] [Nothing]]
]
-[endsect]
+
+
+[heading Free function `make_task()`]
+
+ template< typename Fn, typename A0 >
+ task< R >::type > make_task( Fn fn, A0 a0);
+
+ ...
+
+ template< typename Fn, typename A0, ..., typename A10 >
+ task< R >::type > make_task( Fn fn, A0 a0, ..., A10 a10);
+
+[variablelist
+[[Effects:] [creates an task from function object and arguments]]
+[[Throws:] [Nothing]]
+]
[endsect]
Modified: sandbox/task/libs/task/doc/ref_utility.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_utility.qbk (original)
+++ sandbox/task/libs/task/doc/ref_utility.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -6,8 +6,6 @@
]
-[section:utility Utilities]
-
[section:reschedule_until Non-member function `reschedule_until()`]
``
@@ -131,5 +129,3 @@
[endsect]
-
-[endsect]
Modified: sandbox/task/libs/task/doc/ref_watermark.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_watermark.qbk (original)
+++ sandbox/task/libs/task/doc/ref_watermark.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -20,7 +20,7 @@
};
``
-[section:constructor Constructor]
+[heading Constructor]
explicit high_watermark( std::size_t value)
@@ -28,9 +28,9 @@
[[Effects:] [constructs a `boost::tp::high_watermark` instance]]
[[Throws:] [`boost::task::invalid_watermark`]]
]
-[endsect]
-[section:operator Member function `operator std::size_t()`]
+
+[heading Member function `operator std::size_t()`]
operator std::size_t () const
@@ -38,7 +38,6 @@
[[Effects:] [returns high watermark]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
@@ -57,7 +56,7 @@
};
``
-[section:constructor Constructor]
+[heading Constructor]
explicit low_watermark( std::size_t value)
@@ -65,9 +64,9 @@
[[Effects:] [constructs a `boost::task::low_watermark` instance]]
[[Throws:] [`boost::task::invalid_watermark`]]
]
-[endsect]
-[section:operator Member function `operator std::size_t()`]
+
+[heading Member function `operator std::size_t()`]
operator std::size_t () const
@@ -75,7 +74,6 @@
[[Effects:] [returns low watermark]]
[[Throws:] [Nothing]]
]
-[endsect]
[endsect]
\ No newline at end of file
Modified: sandbox/task/libs/task/doc/scheduler.qbk
==============================================================================
--- sandbox/task/libs/task/doc/scheduler.qbk (original)
+++ sandbox/task/libs/task/doc/scheduler.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -27,14 +27,14 @@
> pool( boost::task::poolsize( 5) );
boost::task::async(
- pool, // thread-pool
boost::task::make_task( some_fn), // task to be executed
- 5); // priority is 5
+ 5, // priority is 5
+ pool); // thread-pool
boost::task::async(
- pool, // thread-pool
boost::task::make_task( another_fn), // task to be executed
- 3); // priority is 3
+ 3, // priority is 3
+ pool); // thread-pool
``
In this example the tasks get scheduled by the assigned integer (third argument of __fn_async__). The __task__ with the
@@ -93,15 +93,16 @@
// replaced by later task with same attribute == 2
// if still pending in pool
boost::task::async(
- pool,
boost::task::make_task( fibonacci_fn, 10),
- 2); // attribute is 2
+ 2, // attribute is 2
+ pool);
// will replace previous pending task with attribute == 2
boost::task::async(
pool,
boost::task::make_task( fibonacci_fn, 5),
- 2); // attribute is 2 too
+ 2, // attribute is 2 too
+ pool);
}
``
Modified: sandbox/task/libs/task/doc/shutdown.qbk
==============================================================================
--- sandbox/task/libs/task/doc/shutdown.qbk (original)
+++ sandbox/task/libs/task/doc/shutdown.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -17,8 +17,6 @@
If __fn_shutdown__ is called - the the pool is set the closed state and all __worker_threads__ are joined until all pending tasks are processed.
No futher tasks can be submitted.
-[note The deconstructor calls __fn_shutdown__ if the pool was not shutdown yet.]
-
``
long fibonacci_fn( long n)
@@ -49,13 +47,13 @@
boost::task::handle< long > h1(
boost::task::async(
- pool, // asynchronous executor
- boost::task::make_task( fibonacci_fn, 10) ) );
+ boost::task::make_task( fibonacci_fn, 10),
+ pool) ); // execution-policy
boost::task::handle< long > h2(
boost::task::async(
- pool, // asynchronous executor
- boost::task::make_task( fibonacci_fn, 5) ) );
+ boost::task::make_task( fibonacci_fn, 5),
+ pool) ); // execution-policy
pool.shutdown();
@@ -64,6 +62,8 @@
}
``
+[note The deconstructor calls __fn_shutdown__ if the pool was not shutdown yet.]
+
[heading Shutdown immediatly]
@@ -99,13 +99,13 @@
boost::task::handle< long > h1(
boost::task::async(
- pool, // asynchronous executor
- boost::task::make_task( fibonacci_fn, 10) ) );
+ boost::task::make_task( fibonacci_fn, 10),
+ pool) ); // execution-policy
boost::task::handle< long > h2(
boost::task::async(
- pool, // asynchronous executor
- boost::task::make_task( fibonacci_fn, 5) ) );
+ boost::task::make_task( fibonacci_fn, 5),
+ pool) ); // execution-policy
pool.shutdown_now();
Modified: sandbox/task/libs/task/doc/task.qbk
==============================================================================
--- sandbox/task/libs/task/doc/task.qbk (original)
+++ sandbox/task/libs/task/doc/task.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -10,7 +10,7 @@
A task is a chunk of code that can be executed independently.
-__task__ represents a __callable__ (provides __fn_operator__) object containing the unit of code to be execute by a __ae__.
+__task__ represents a __callable__ (provides __fn_operator__) object containing the unit of code to be execute by a __ep__.
Function __fn_get_future__ returns a __act__ allowing to wait for the completion of the computation of the task, for
getting the result of a computation or for transfering exceptions. Each __task__ has a unique identifier.
@@ -108,10 +108,10 @@
{
boost::task::handle< long > h( // get handle associated with the task
boost::task::async(
- boost::task::new_thread(), // asynchronous executor
boost::task::make_task( // task, to be executed asynchronously
cooperative,
- 10) ) );
+ 10),
+ boost::task::new_thread() ) ); // execution-policy
std::cout << h.get() << std::endl; // throws boost::task::task_interrupted
}
``
@@ -133,9 +133,9 @@
{
boost::task::handle< void > h( // get handle associated with the task
boost::task::async(
- boost::task::new_thread(), // asynchronous executor
boost::task::make_task( // task, to be executed asynchronously
- throwing) ) );
+ throwing),
+ boost::task::new_thread() ) ); // execution-policy
std::cout << h.wait() << std::endl; // throws std::domain_error
}
``
@@ -167,7 +167,7 @@
[heading Parent task]
-Top-level tasks have no parent. A parent task can create child tasks when it creates another task by using __as_sub_task__ as __ae__. These children are implicitly treated as __sub_tasks__ of the larger task. It is assumed that that __sub_tasks__ can be executed in any order because only overall operation
+Top-level tasks have no parent. A parent task can create child tasks when it creates another task by using __as_sub_task__ as __ep__. These children are implicitly treated as __sub_tasks__ of the larger task. It is assumed that that __sub_tasks__ can be executed in any order because only overall operation
speed matters (enabling strategies for fast execution of unordered __work_items__ as [link_work_stealing __work_stealing__]).
``
@@ -184,18 +184,18 @@
{
// submit a sub-task to pool calculating fibonacci(n-1)
h1 = boost::task::async(
- boost::task::as_sub_task(), // execute a sub-task
boost::task::make_task(
parallel_fib,
n - 1,
cutof) );
+
// submit a sub-task to pool calculating fibonacci(n-2)
h2 = boost::task::async(
- boost::task::as_sub_task(), // execute a sub-task
boost::task::make_task(
parallel_fib,
n - 2,
cutof) );
+
// calculate fibonacci(n) from the results of both sub-tasks
return h1.get() + h2.get();
}
@@ -203,13 +203,13 @@
void main()
{
- boost::task::handle< long > h( // handle for fibonacci calculation
+ boost::task::handle< long > h( // handle for fibonacci calculation
boost::task::async(
- boost::task::default_pool(), // access the default thread-pool
- boost::task::make_task( // calculate fibonacci number 10
- parallel_fib, // for numbers < 5 do inline recursive calculation
+ boost::task::make_task( // calculate fibonacci number 10
+ parallel_fib, // for numbers < 5 do inline recursive calculation
10,
- 5) ) );
+ 5),
+ boost::task::default_pool() ) ); // access the default thread-pool
std::cout << h.get() << std::endl;
}
``
Modified: sandbox/task/libs/task/doc/todo.qbk
==============================================================================
--- sandbox/task/libs/task/doc/todo.qbk (original)
+++ sandbox/task/libs/task/doc/todo.qbk 2009-06-08 15:38:16 EDT (Mon, 08 Jun 2009)
@@ -45,7 +45,7 @@
[heading Support of explicit processor bindig]
-* __aes__ related to a __thread_pool__ (like __default_pool__) could support explicit processor binding.
+* __eps__ related to a __thread_pool__ (like __default_pool__) could support explicit processor binding.
[heading Optimizations]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk