Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54286 - in sandbox/task/libs/task: . doc doc/html doc/html/boost_task doc/html/images doc/html/images/accumulators doc/html/images/callouts
From: oliver.kowalke_at_[hidden]
Date: 2009-06-23 14:17:00


Author: olli
Date: 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
New Revision: 54286
URL: http://svn.boost.org/trac/boost/changeset/54286

Log:
*documentation

Added:
   sandbox/task/libs/task/boost.png (contents, props changed)
   sandbox/task/libs/task/doc/html/
   sandbox/task/libs/task/doc/html/boost_task/
   sandbox/task/libs/task/doc/html/boost_task/appendices.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/as_sub_task.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/async.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/handle.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/meta_functions.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/motivation.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/new_thread.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/own_thread.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/pool.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/reference.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/task.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boost_task/utilities.html (contents, props changed)
   sandbox/task/libs/task/doc/html/boostbook.css (contents, props changed)
   sandbox/task/libs/task/doc/html/docutils.css (contents, props changed)
   sandbox/task/libs/task/doc/html/images/
   sandbox/task/libs/task/doc/html/images/accumulators/
   sandbox/task/libs/task/doc/html/images/accumulators/doxygen.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_0.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_1.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_10.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_100.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_11.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_12.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_13.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_14.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_15.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_16.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_17.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_18.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_19.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_2.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_20.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_21.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_22.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_23.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_24.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_25.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_26.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_27.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_28.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_29.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_3.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_30.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_31.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_32.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_33.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_34.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_35.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_36.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_37.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_38.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_39.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_4.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_40.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_41.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_42.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_43.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_44.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_45.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_46.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_47.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_48.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_49.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_5.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_50.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_51.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_52.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_53.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_54.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_55.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_56.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_57.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_58.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_59.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_6.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_60.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_61.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_62.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_63.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_64.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_65.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_66.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_67.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_68.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_69.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_7.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_70.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_71.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_72.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_73.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_74.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_75.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_76.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_77.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_78.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_79.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_8.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_80.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_81.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_82.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_83.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_84.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_85.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_86.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_87.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_88.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_89.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_9.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_90.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_91.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_92.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_93.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_94.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_95.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_96.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_97.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_98.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/accumulators/form_99.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/alert.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/blank.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/
   sandbox/task/libs/task/doc/html/images/callouts/1.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/10.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/11.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/12.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/13.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/14.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/15.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/2.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/3.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/4.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/5.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/6.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/7.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/8.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/callouts/9.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/caution.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/draft.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/home.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/important.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/next.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/next_disabled.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/note.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/prev.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/prev_disabled.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/smiley.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/tip.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/toc-blank.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/toc-minus.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/toc-plus.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/up.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/up_disabled.png (contents, props changed)
   sandbox/task/libs/task/doc/html/images/warning.png (contents, props changed)
   sandbox/task/libs/task/doc/html/index.html (contents, props changed)
   sandbox/task/libs/task/doc/html/minimal.css (contents, props changed)
   sandbox/task/libs/task/doc/html/reference.css (contents, props changed)
Text files modified:
   sandbox/task/libs/task/doc/acknowledgements.qbk | 2
   sandbox/task/libs/task/doc/async.qbk | 2
   sandbox/task/libs/task/doc/boost_task.xml | 2819 +++++++++++++++++++++++++--------------
   sandbox/task/libs/task/doc/fork_join.qbk | 18
   sandbox/task/libs/task/doc/introduction.qbk | 57
   sandbox/task/libs/task/doc/meta_functions.qbk | 8
   sandbox/task/libs/task/doc/new_thread.qbk | 6
   sandbox/task/libs/task/doc/overview.qbk | 34
   sandbox/task/libs/task/doc/pool.qbk | 8
   sandbox/task/libs/task/doc/processor_binding.qbk | 3
   sandbox/task/libs/task/doc/ref_static_pool.qbk | 2
   sandbox/task/libs/task/doc/scheduler.qbk | 31
   sandbox/task/libs/task/doc/shutdown.qbk | 10
   sandbox/task/libs/task/doc/static_pool.qbk | 16
   sandbox/task/libs/task/doc/task.qbk | 42
   15 files changed, 1953 insertions(+), 1105 deletions(-)

Added: sandbox/task/libs/task/boost.png
==============================================================================
Binary file. No diff available.

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -8,7 +8,7 @@
 
 [section:acknowledgements Appendix B: Acknowledgments]
 
-I'd like to thank Vicente J. Botet Escriba for his contributions (this_task::reschedule_until, this_task::delay, this_task::yield) an comments and Anthony Williams and Braddock Gaskill for their future libraries.
+I'd like to thank Vicente J. Botet Escriba for his comments and contributions (this_task::reschedule_until, this_task::delay, this_task::yield) as well Anthony Williams and Braddock Gaskill for their future libraries.
 
 
 [endsect]

Modified: sandbox/task/libs/task/doc/async.qbk
==============================================================================
--- sandbox/task/libs/task/doc/async.qbk (original)
+++ sandbox/task/libs/task/doc/async.qbk 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -31,7 +31,7 @@
 
         void main()
         {
- // task -> compute fibonacci(10)
+ // task computing fibonacci(10)
                 boost::task< long > t( fibonacci, 10);
 
                 // move the task to executor

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-23 14:16:55 EDT (Tue, 23 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/08 19:40:03 $"
+<library id="boost_task" name="Boost.Task" dirname="boost_task" last-revision="$Date: 2009/06/23 18:15:41 $"
  xmlns:xi="http://www.w3.org/2001/XInclude">
   <libraryinfo>
     <authorgroup>
@@ -26,21 +26,17 @@
   <section id="boost_task.overview">
     <title><link linkend="boost_task.overview"> Overview</link></title>
     <para>
- <emphasis role="bold">Boost.Task</emphasis> provides an framework for parallel
+ <emphasis role="bold">Boost.Task</emphasis> provides a framework for parallel
       execution of tasks (a task is a small unit of code that can be executed independently).
     </para>
     <itemizedlist>
       <listitem>
         <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>, <emphasis>callable</emphasis> representing
+ role="identifier">task</phrase></code>, a <emphasis>callable</emphasis> representing
         a fine-grained work-item:
         <itemizedlist>
           <listitem>
- <code><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase></code>
- returning an identifier
- </listitem>
- <listitem>
             <code><phrase role="keyword">operator</phrase><phrase role="special">()()</phrase></code>
             to execute the fine-grained work-item
           </listitem>
@@ -54,19 +50,16 @@
       <listitem>
         <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>, <emphasis>asynchronous-completion-token</emphasis>
- of the asynchronously executed task:
+ role="identifier">handle</phrase></code>, works as a <emphasis>asynchronous-completion-token</emphasis>
+ of executed task:
         <itemizedlist>
           <listitem>
- <code><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase></code>
- for identifying associated task
- </listitem>
- <listitem>
             <code><phrase role="identifier">interrupt</phrase><phrase role="special">()</phrase></code>,
- interrupt_and_wait() allow to cancel an cooperative task
+ <code><phrase role="identifier">interrupt_and_wait</phrase><phrase role="special">()</phrase></code>,
+ ... allow to cancel an cooperative task
           </listitem>
           <listitem>
- interface of <emphasis>asynchronous-completion-token</emphasis>:
+ interface of the <emphasis>asynchronous-completion-token</emphasis>:
             <itemizedlist>
               <listitem>
                 <code><phrase role="identifier">get</phrase><phrase role="special">()</phrase></code>
@@ -86,7 +79,8 @@
           </listitem>
           <listitem>
             <code><phrase role="identifier">get_future</phrase><phrase role="special">()</phrase></code>
- returns reference to internal future
+ returns reference to internal <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">shared_future</phrase></code>
           </listitem>
           <listitem>
             functions <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
@@ -103,7 +97,7 @@
         <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>execution-policies</emphasis> asynchronously
+ executes a task by means of <emphasis>execution-policies</emphasis>
       </listitem>
       <listitem>
         <emphasis>execution-policy</emphasis> models:
@@ -112,36 +106,31 @@
             <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
             role="identifier">task</phrase><phrase role="special">::</phrase><phrase
             role="identifier">own_thread</phrase></code>: executes task in current
- thread.
- </listitem>
- <listitem>
- <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>: executes task in a newly
- created thread (thread will be destroyed after)
+ thread
           </listitem>
           <listitem>
             <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>: task gets executed by
- a <emphasis>worker-thread</emphasis> of the default <emphasis>thread-pool</emphasis>
+ role="identifier">new_thread</phrase></code>: executes task in a newly-created
+ thread (thread will be destroyed after completion)
           </listitem>
           <listitem>
             <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>: executes task in newly
- created thread or in a pool of <emphasis>worker-threads</emphasis> depending
- on whether current task is already executed in a pool
+ role="identifier">as_sub_task</phrase></code>: executes task in newly-created
+ thread or in a pool of <emphasis>worker-threads</emphasis> depending
+ on whether the parent-task is already executed in a <emphasis>thread-pool</emphasis>
           </listitem>
           <listitem>
- custom pool: task gets executed by a <emphasis>worker-thread</emphasis>
+ <emphasis>thread-pool</emphasis>: task gets executed by a <emphasis>worker-thread</emphasis>
             of a custom <emphasis>thread-pool</emphasis> (for instance with priority
- scheduling)
+ or smart scheduling)
           </listitem>
         </itemizedlist>
       </listitem>
       <listitem>
- <emphasis>thread-pools</emphasis> with work-stealing algorithm
+ <emphasis>thread-pools</emphasis> with work-stealing algorithm and for/join
+ semantics
       </listitem>
       <listitem>
         support of forking and joining sub-tasks
@@ -153,8 +142,8 @@
             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
+ detects if parent-task runs in a <emphasis>thread-pool</emphasis> - the
+ appropriate mechanism for executing the sub-tasks is choosen
           </listitem>
         </itemizedlist>
       </listitem>
@@ -203,28 +192,43 @@
 
 <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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">(</phrase>
+ <phrase role="comment">// create a thread-pool
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase>
+ <phrase role="special">&gt;</phrase>
+ <phrase role="special">&gt;</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="comment">// create two tasks, computing fibonacci numbers
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</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="comment">// execute tasks in thread-pool
+</phrase> <phrase role="comment">// move tasks ownership to executor
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</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">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">&lt;&lt;</phrase> <phrase role="string">&quot;h1: id == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;h2: id == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">);</phrase>
+
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;h1: is ready == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;h2: is ready == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</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="comment">// wait for completion of both tasks
+</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">&lt;&lt;</phrase> <phrase role="string">&quot;h1: is ready == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;h2: is ready == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;h1: has value == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;h2: has value == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;h1: has exception == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;h2: has exception == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+
+ <phrase role="comment">// get results
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(5) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
 <phrase role="special">}</phrase>
 </programlisting>
@@ -267,6 +271,12 @@
         role="bold">Boost.Thread</emphasis></ulink>).
       </para>
     </note>
+ <note>
+ <para>
+ Please note that <emphasis role="bold">Boost.Task</emphasis> is not optimized
+ yet.
+ </para>
+ </note>
     <anchor id="boost_task.overview.tested_platforms"/>
     <bridgehead renderas="sect3">
       <link linkend="boost_task.overview.tested_platforms">Tested Platforms</link>
@@ -286,29 +296,28 @@
         FreeBSD 7.2 (x86), GCC 4.2.1
       </listitem>
       <listitem>
+ OpenSolaris 2009.06 (x86_64), GCC 4.3.2
+ </listitem>
+ <listitem>
         Windows XP Professional (x86), MSVC 9.0
       </listitem>
     </itemizedlist>
- <anchor id="boost_task.overview.how_to_build"/>
+ <anchor id="boost_task.overview.how_to_build_and_install"/>
     <bridgehead renderas="sect3">
- <link linkend="boost_task.overview.how_to_build">How to build</link>
+ <link linkend="boost_task.overview.how_to_build_and_install">How to build and
+ install</link>
     </bridgehead>
     <itemizedlist>
       <listitem>
- download the sources form <ulink url="http://www.boostpro.com/vault/index.php">boost-vault</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>
+ download the sources form <ulink url="http://www.boost-consulting.com/vault/index.php?directory=Concurrent%20Programming">Boost
+ Vault</ulink> 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
       </listitem>
       <listitem>
- change directory to &lt;boost-source&gt;/libs/task/build
- </listitem>
- <listitem>
- call <code><phrase role="identifier">bjam</phrase> <phrase role="identifier">toolset</phrase><phrase
- role="special">=&lt;</phrase><phrase role="identifier">compiler</phrase><phrase
- role="special">-</phrase><phrase role="identifier">name</phrase><phrase role="special">&gt;</phrase></code>
+ call <emphasis>'bjam toolset=&lt;compiler-name&gt; --with-task install'</emphasis>
+ in order to build and install <emphasis role="bold">Boost.Task</emphasis>
       </listitem>
     </itemizedlist>
   </section>
@@ -353,19 +362,22 @@
 
 <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">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">&quot;Hello World!&quot;</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>
+ <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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase> <phrase role="identifier">print</phrase><phrase role="special">,</phrase> <phrase role="string">&quot;Hello World!&quot;</phrase><phrase role="special">);</phrase>
+
+ <phrase role="comment">// execute task in newly-created thread
+</phrase> <phrase role="comment">// move task ownership to executor
+</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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="special">}</phrase>
 </programlisting>
     </para>
     <para>
       In order to manage the task <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
- a handle <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ 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>
       (associated with the submitted task). It functions as a <emphasis>asynchronous-completion-token</emphasis>
       - that means it transfers the result of the execution back to the caller thread.
@@ -377,14 +389,19 @@
 
 <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">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</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">// task, to be executed asynchronously
-</phrase> <phrase role="identifier">echo</phrase><phrase role="special">,</phrase>
- <phrase role="string">&quot;Hello World!&quot;</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">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
+ <phrase role="comment">// task returning the submitted string
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase> <phrase role="identifier">echo</phrase><phrase role="special">,</phrase> <phrase role="string">&quot;Hello World!&quot;</phrase><phrase role="special">);</phrase>
+
+ <phrase role="comment">// execute task in newly-created thread
+</phrase> <phrase role="comment">// move task ownership to executor
+</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">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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">// wait until task has finished and return the result
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
@@ -400,28 +417,35 @@
 
 <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">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</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">// 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="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">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
+ <phrase role="comment">// create a long runing task
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</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="comment">// execute task in newly-created thread
+</phrase> <phrase role="comment">// move task ownership to executor
+</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">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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">// requests interruption of task
+</phrase> <phrase role="comment">// returns immediately
+</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">interrupt</phrase><phrase role="special">();</phrase>
+
+ <phrase role="comment">// access the result
+</phrase> <phrase role="comment">// task_interrupted exeception will be thrown
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
       Beside <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>
- (which creates a new task for each submitted task) <emphasis role="bold">Boost.Task</emphasis>
- provides <link linkend="boost_task.pool"><emphasis>thread-pools</emphasis></link>
- to prevent the overhead of thread creation and destruction for each task.
- <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>
- submitts the tasks to the default <emphasis>thread-pool</emphasis> which contains
- a fixed number of pre-spawned <emphasis>worker-threads</emphasis> (custom
- <emphasis>thread-pools</emphasis> are supported too).
+ (which creates a new task for each submitted task - the thread will be joined
+ by <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>)
+ <emphasis role="bold">Boost.Task</emphasis> provides <link linkend="boost_task.pool"><emphasis>thread-pools</emphasis></link>
+ to prevent the overhead of thread creation and destruction of threads for each
+ task (<emphasis>thread-pools</emphasis> can be customized).
     </para>
     <para>
       
@@ -436,21 +460,26 @@
         <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">&lt;</phrase> <phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="identifier">serial_fib</phrase><phrase role="special">(</phrase> <phrase role="identifier">n</phrase><phrase role="special">);</phrase>
         <phrase role="keyword">else</phrase>
         <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">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="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">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="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">// create a sub-task calculating fibonacci(n-1)
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</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="comment">// create a sub-task calculating fibonacci(n-2)
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</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="comment">// fork two sub-tasks
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</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="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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</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="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>
@@ -459,14 +488,28 @@
 
 <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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">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 &lt; 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="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">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// create a thread-pool with five worker-threads
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase>
+ <phrase role="special">&gt;</phrase>
+ <phrase role="special">&gt;</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="comment">// create task computing fibonacci-number for 10
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
+ <phrase role="number">10</phrase><phrase role="special">,</phrase>
+ <phrase role="number">5</phrase><phrase role="special">);</phrase>
+
+ <phrase role="comment">// execute task in a thread-pool
+</phrase> <phrase role="comment">// move task ownership to executor
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</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="special">);</phrase>
+
+ <phrase role="comment">// access the result
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
@@ -485,13 +528,18 @@
     </para>
     <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">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="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>
+<programlisting><phrase role="comment">// create a long runing task
+</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
+ <phrase role="number">10</phrase><phrase role="special">,</phrase>
+ <phrase role="number">5</phrase><phrase role="special">);</phrase>
+
+<phrase role="comment">// move task ownership to executor
+</phrase><phrase role="comment">// sub-task executed in a new thread or inside the 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">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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>
+</programlisting>
     </para>
   </section>
   <section id="boost_task.task">
@@ -508,75 +556,9 @@
       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
- a computation or for transfering exceptions. Each <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> has a unique identifier.
- </para>
- <anchor id="boost_task.task.creation"/>
- <bridgehead renderas="sect3">
- <link linkend="boost_task.task.creation">Creation</link>
- </bridgehead>
- <para>
- <code><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></code> can be used to create <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> by passing free-functions or member-functions
- of objects and its arguments: <code><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></code>
- accepts up to ten arguments per default (can be overriden by defining BOOST_TASK_MAKE_TASK_MAX_ARITY
- with the new value).
- </para>
- <itemizedlist>
- <listitem>
- create task from free-function with arguments:
- </listitem>
- </itemizedlist>
- <para>
-
-<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
-</programlisting>
- </para>
- <itemizedlist>
- <listitem>
- create task from member-function with arguments:
- </listitem>
- </itemizedlist>
- <para>
-
-<programlisting><phrase role="keyword">struct</phrase> <phrase role="identifier">X</phrase>
-<phrase role="special">{</phrase>
- <phrase role="keyword">void</phrase> <phrase role="identifier">f</phrase><phrase role="special">(</phrase> <phrase role="keyword">int</phrase> <phrase role="identifier">i</phrase><phrase role="special">);</phrase>
-<phrase role="special">};</phrase>
-
-<phrase role="identifier">X</phrase> <phrase role="identifier">x</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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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">&amp;</phrase> <phrase role="identifier">X</phrase><phrase role="special">::</phrase><phrase role="identifier">f</phrase><phrase role="special">,</phrase>
- <phrase role="identifier">x</phrase><phrase role="special">,</phrase>
- <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
-</programlisting>
- </para>
- <para>
- It is possible to create <code><phrase role="identifier">boost</phrase><phrase
+ a computation or for transfering exceptions. <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> from a <emphasis>callable</emphasis>
- too:
- </para>
- <para>
-
-<programlisting><phrase role="keyword">struct</phrase> <phrase role="identifier">Y</phrase>
-<phrase role="special">{</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="keyword">operator</phrase><phrase role="special">()();</phrase>
-<phrase role="special">};</phrase>
-
-<phrase role="identifier">Y</phrase> <phrase role="identifier">y</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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase> <phrase role="identifier">y</phrase><phrase role="special">);</phrase>
-</programlisting>
+ role="identifier">task</phrase></code> supports move semantics (moving ownership).
     </para>
     <anchor id="boost_task.task.cooperative_task_and_interruption"/>
     <bridgehead renderas="sect3">
@@ -658,36 +640,49 @@
       
 <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 role="comment">// interruption point
+</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="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">&lt;=</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="comment">// check if interruption was requested
+</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="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="comment">// interruption point
+</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="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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">// 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="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">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
+ <phrase role="comment">// task for computing fibonacci-number
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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="comment">// execute task in new thread
+</phrase> <phrase role="comment">// move task ownership to executor
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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">// interrupt task an wait until
+</phrase> <phrase role="comment">// the task is removed by the worker-thread
+</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">interrupt_and_wait</phrase><phrase role="special">();</phrase>
+
+ <phrase role="comment">// access the result
+</phrase> <phrase role="comment">// throws boost::task::task_interrupted
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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.task.exceptions"/>
@@ -710,13 +705,20 @@
 
 <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">&lt;</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</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">// 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">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">wait</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
+ <phrase role="comment">// create task throwing std::domain_error
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase> <phrase role="identifier">throwing</phrase><phrase role="special">);</phrase>
+
+ <phrase role="comment">// execute task asynchron
+</phrase> <phrase role="comment">// move task ownership to executor
+</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">&lt;</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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">// wait for task completion
+</phrase> <phrase role="comment">// throws std::domain_error
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">wait</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
@@ -782,15 +784,15 @@
       </listitem>
       <listitem>
         <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">future_already_set</phrase></code>
+ role="identifier">exception</phrase></code>
       </listitem>
       <listitem>
         <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">future_cancel</phrase></code>
+ role="identifier">future_already_set</phrase></code>
       </listitem>
       <listitem>
         <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">exception</phrase></code>
+ role="identifier">future_cancel</phrase></code>
       </listitem>
       <listitem>
         <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
@@ -802,12 +804,36 @@
       </listitem>
       <listitem>
         <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">broken_task</phrase></code>
+ </listitem>
+ <listitem>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
+ </listitem>
+ <listitem>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_already_executed</phrase></code>
+ </listitem>
+ <listitem>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_interrupted</phrase></code>
+ </listitem>
+ <listitem>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_moved</phrase></code>
+ </listitem>
+ <listitem>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
         role="identifier">task</phrase><phrase role="special">::</phrase><phrase
         role="identifier">task_interrupted</phrase></code>
       </listitem>
       <listitem>
         <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">broken_task</phrase></code>
+ role="identifier">task_task_rejected</phrase></code>
+ </listitem>
+ <listitem>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_unitialized</phrase></code>
       </listitem>
     </itemizedlist>
     <anchor id="boost_task.task.parent_task"/>
@@ -838,35 +864,56 @@
         <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">&lt;</phrase> <phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="identifier">serial_fib</phrase><phrase role="special">(</phrase> <phrase role="identifier">n</phrase><phrase role="special">);</phrase>
         <phrase role="keyword">else</phrase>
         <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">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">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">// sub-task for computing fibonacci(n-1)
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</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="comment">// sub-task for computing fibonacci(n-2)
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</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="comment">// submit a sub-tasks to thread-pool
+</phrase> <phrase role="comment">// move task ownership to executor
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
 
- <phrase role="comment">// calculate fibonacci(n) from the results of both sub-tasks
+ <phrase role="comment">// computing fibonacci(n) by
+</phrase> <phrase role="comment">// joining 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>
 <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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">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 &lt; 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="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">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// create thread-pool with five worker-threads
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase>
+ <phrase role="special">&gt;</phrase>
+ <phrase role="special">&gt;</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="comment">// create task computing fibonacci-number for 10
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
+ <phrase role="number">10</phrase><phrase role="special">,</phrase>
+ <phrase role="number">5</phrase><phrase role="special">);</phrase>
+
+ <phrase role="comment">// execute task asynchron in thread-pool
+</phrase> <phrase role="comment">// move task ownership to executor
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</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="special">);</phrase>
+
+ <phrase role="comment">// access result
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
@@ -910,10 +957,6 @@
     </para>
     <itemizedlist>
       <listitem>
- <code><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase></code>:
- return id of the associated <emphasis>task-id</emphasis>
- </listitem>
- <listitem>
         <code><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase></code>:
         test if result is set
       </listitem>
@@ -960,18 +1003,25 @@
 
 <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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
+ <phrase role="comment">// create task
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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="comment">// move task ownership to executor
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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">&lt;&lt;</phrase> <phrase role="string">&quot;id == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
+
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;is ready == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</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="comment">// wait for task completion
+</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">wait</phrase><phrase role="special">();</phrase>
+
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;has value == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;has exception == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+
+ <phrase role="comment">// return result
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
@@ -1067,25 +1117,33 @@
 
 <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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">// 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="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 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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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="comment">// move task to async. executor
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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">// interrupt task and wait until task is removed by worker-thread
 </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">&lt;&lt;</phrase> <phrase role="string">&quot;id == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
+
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;is ready == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;has value == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">has_value</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;has exception == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
+
+ <phrase role="comment">// access result
+</phrase> <phrase role="comment">// throws boost::task::task_interrupted
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
     <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.
+ If the task is still pending (not executed yet) 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"/>
@@ -1107,11 +1165,13 @@
         <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">&lt;</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="special">{</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase> <phrase role="identifier">fibonacci</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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>
@@ -1136,23 +1196,19 @@
       
 <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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t3</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t3</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>
@@ -1170,9 +1226,9 @@
   <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
+ 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></code> applies the moved <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
@@ -1183,20 +1239,21 @@
       <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">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
+ <phrase role="special">&amp;&amp;</phrase> <phrase role="identifier">t</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">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>.
+ 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>
       
@@ -1216,14 +1273,17 @@
 
 <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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">&lt;&lt;</phrase> <phrase role="string">&quot;id == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get_id</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
+ <phrase role="comment">// task computing fibonacci(10)
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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="comment">// move the task to executor
+</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
+ <phrase role="comment">// access the result
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
@@ -1254,12 +1314,13 @@
 
 <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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
 <phrase role="special">}</phrase>
 </programlisting>
@@ -1276,8 +1337,7 @@
       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>.
+ (if the last reference gets out of scope) .
     </para>
     <para>
       
@@ -1297,12 +1357,13 @@
 
 <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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
 <phrase role="special">}</phrase>
 </programlisting>
@@ -1319,19 +1380,26 @@
     <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
- role="special">()</phrase></code> are executed synchron (see <link linkend="boost_task.own_thread"><code><phrase
- role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase
- role="special">::</phrase><phrase role="identifier">own_thread</phrase></code></link>
- for synchronous execution)!
+ role="special">()</phrase></code> are executed synchron because 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>
+ is not stored in a variable. Thatswhy the <emphasis>worker-thread</emphasis>
+ is joined after return from <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">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">a_function</phrase><phrase role="special">),</phrase>
+<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">(</phrase> <phrase role="identifier">another_function</phrase><phrase role="special">);</phrase>
+
+<phrase role="comment">// handles are not retrieved
+</phrase><phrase role="comment">// both task executed in sequence
+</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</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">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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</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>
@@ -1355,11 +1423,7 @@
       role="identifier">async</phrase><phrase role="special">()</phrase></code> with
       support of executing 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> in <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> (using <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><phrase role="special">()</phrase></code>):
+ role="identifier">task</phrase></code> in <emphasis>thread-pool</emphasis>:
     </para>
     <para>
       
@@ -1368,42 +1432,28 @@
 
 <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">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</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">make_task</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">echo</phrase><phrase role="special">,</phrase>
- <phrase role="string">&quot;Hello World!&quot;</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">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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 a custom <emphasis>thread-pool</emphasis> (passing pool instance as an
- argument 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>):
- </para>
- <para>
-
-<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">echo</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">&amp;</phrase> <phrase role="identifier">msg</phrase><phrase role="special">)</phrase>
-<phrase role="special">{</phrase> <phrase role="keyword">return</phrase> <phrase role="identifier">msg</phrase><phrase role="special">;</phrase> <phrase role="special">}</phrase>
+ <phrase role="comment">// create a thread-pool with
+</phrase> <phrase role="comment">// five worker-threads
+</phrase> <phrase role="comment">// FIFO schduling of queued tasks
+</phrase> <phrase role="comment">// and unlimited size of internal queue
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase>
+ <phrase role="special">&gt;</phrase>
+ <phrase role="special">&gt;</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">static_pool</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase>
- <phrase role="special">&gt;</phrase>
-<phrase role="special">&gt;</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="comment">// create task
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase> <phrase role="identifier">echo</phrase><phrase role="special">,</phrase> <phrase role="string">&quot;Hello World!&quot;</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">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
+ <phrase role="comment">// move task to executor
+</phrase> <phrase role="comment">// let the task be executed by the thread-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">&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="special">&gt;</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">make_task</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">echo</phrase><phrase role="special">,</phrase>
- <phrase role="string">&quot;Hello World!&quot;</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</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="special">);</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+
+ <phrase role="comment">// access the result
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
@@ -1427,18 +1477,21 @@
         role="special">::</phrase><phrase role="identifier">task</phrase><phrase
         role="special">::</phrase><phrase role="identifier">static_pool</phrase></code>
         - which contains an fixed set of pre-forked <emphasis>worker-threads</emphasis>
- (the size of the pool doesn't change during its lifetime).
+ (the size of the pool doesn't change during its lifetime). <code><phrase
+ role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">static_pool</phrase></code> supports move semantics.
       </para>
       <para>
         
-<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">_static_pool</phrase><phrase role="special">&lt;</phrase> <phrase role="comment">// pool type
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase> <phrase role="comment">// queuing policy (unbounded_channel, bounded_channel)
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase> <phrase role="comment">// scheduling policy (fifo, priority, smart)
-</phrase> <phrase role="special">&gt;</phrase>
+<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">_static_pool</phrase><phrase role="special">&lt;</phrase> <phrase role="comment">// pool type
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase> <phrase role="comment">// queuing policy (unbounded_channel, bounded_channel)
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase> <phrase role="comment">// scheduling policy (fifo, priority, smart)
+</phrase> <phrase role="special">&gt;</phrase>
 <phrase role="special">&gt;</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">6</phrase><phrase role="special">),</phrase> <phrase role="comment">// pool with 6 pre-forked worker-threads
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">posix_time</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">50</phrase><phrase role="special">),</phrase> <phrase role="comment">// time to sleep if no work-item available
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">scanns</phrase><phrase role="special">(</phrase> <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// iterations over local-queues before sleep
+ <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">6</phrase><phrase role="special">),</phrase> <phrase role="comment">// pool with 6 pre-forked worker-threads
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">posix_time</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">50</phrase><phrase role="special">),</phrase> <phrase role="comment">// time to sleep if no work-item available
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">scanns</phrase><phrase role="special">(</phrase> <phrase role="number">10</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase> <phrase role="comment">// iterations over local-queues before sleep
 </phrase></programlisting>
       </para>
       <para>
@@ -1468,16 +1521,16 @@
         role="identifier">size</phrase><phrase role="special">()</phrase></code>.
       </para>
       <para>
- For infomational pruposes <code><phrase role="identifier">empty</phrase><phrase
+ For informational pruposes <code><phrase role="identifier">empty</phrase><phrase
         role="special">()</phrase></code> and <code><phrase role="identifier">pending</phrase><phrase
- role="special">()()</phrase></code> can be used in order to know if the global
+ role="special">()</phrase></code> can be used in order to know if the global
         task-queue is empty or how many tasks are waiting for execution. With <code><phrase
         role="identifier">clear</phrase><phrase role="special">()</phrase></code>
         all tasks are removed from the global-queue.
       </para>
       <note>
         <para>
- <code><phrase role="identifier">pending</phrase><phrase role="special">()()</phrase></code>
+ <code><phrase role="identifier">pending</phrase><phrase role="special">()</phrase></code>
           does not count tasks in the local-queues of the <emphasis>worker-threads</emphasis>.
         </para>
       </note>
@@ -1568,21 +1621,29 @@
       </para>
       <para>
         
-<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase> <phrase role="comment">// allow unlimited tasks to be queue in global-queue
-</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">priority</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&gt;</phrase> <phrase role="comment">// tasks with lower priority are scheduled first
-</phrase><phrase role="special">&gt;</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>
+<programlisting><phrase role="comment">// thread-pool with priority scheduling
+</phrase><phrase role="comment">// tasks with higher priority are
+</phrase><phrase role="comment">// scheduled first
+</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">priority</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="special">&gt;</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">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">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>
+<phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">(</phrase> <phrase role="identifier">some_fn</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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">void</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">(</phrase> <phrase role="identifier">another_fn</phrase><phrase role="special">);</phrase>
+
+<phrase role="comment">// move task t1 with priority 5 to 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">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</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="comment">// move task t2 with priority 3 to 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">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</phrase><phrase role="special">),</phrase>
+ <phrase role="number">3</phrase><phrase role="special">,</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">);</phrase>
+</programlisting>
       </para>
       <para>
         In this example the tasks get scheduled by the assigned integer (third argument
@@ -1597,15 +1658,18 @@
         role="special">::</phrase><phrase role="identifier">task</phrase><phrase
         role="special">::</phrase><phrase role="identifier">priority</phrase></code>
         (the default is <code><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase
- role="identifier">less</phrase><phrase role="special">&lt;</phrase> <phrase
+ role="identifier">greater</phrase><phrase role="special">&lt;</phrase> <phrase
         role="identifier">Attr</phrase> <phrase role="special">&gt;</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">static_pool</phrase><phrase role="special">&lt;</phrase>
+<programlisting><phrase role="comment">// thread-pool with priority scheduling
+</phrase><phrase role="comment">// tasks with lower priority are
+</phrase><phrase role="comment">// scheduled first
+</phrase><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
         <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">priority</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase><phrase role="special">,</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">greater</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&gt;</phrase> <phrase role="comment">// tasks with higher priority are scheduled first
-</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">priority</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase><phrase role="special">,</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">less</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="special">&gt;</phrase>
 <phrase role="special">&gt;</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>
 </programlisting>
       </para>
@@ -1663,19 +1727,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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">bind</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">bind</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="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">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="identifier">pool</phrase><phrase role="special">);</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</phrase><phrase role="special">),</phrase>
+ <phrase role="number">2</phrase><phrase role="special">,</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="identifier">pool</phrase><phrase role="special">);</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</phrase><phrase role="special">),</phrase>
+ <phrase role="number">2</phrase><phrase role="special">,</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">);</phrase>
 <phrase role="special">}</phrase>
 </programlisting>
       </para>
@@ -1730,17 +1798,20 @@
 
         <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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</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">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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_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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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_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">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
+ <phrase role="comment">// waits until all pending tasks are finished
+</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">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
         <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(5) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
@@ -1791,110 +1862,60 @@
 
         <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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</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">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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_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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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_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">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</phrase><phrase role="special">),</phrase>
+ <phrase role="identifier">pool</phrase><phrase role="special">)</phrase> <phrase role="special">);</phrase>
+
+ <phrase role="comment">// requests task interruption and
+</phrase> <phrase role="comment">// joins all worker-threads
+</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">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase> <phrase role="comment">// may throw broken_task or task_interrupted
-</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(5) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase> <phrase role="comment">// may throw broken_task or task_interrupted
-</phrase><phrase role="special">}</phrase>
+ <phrase role="comment">// accessing the result may throw task_interrupted
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(5) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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.pool.default_pool">
- <title><link linkend="boost_task.pool.default_pool"> Default pool</link></title>
+ <section id="boost_task.pool.processor_binding">
+ <title><link linkend="boost_task.pool.processor_binding"> Processor binding</link></title>
       <para>
- The library provides a default-pool accessible via <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><phrase
- role="special">()</phrase></code>. The function returns a reference to <code><phrase
- role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">task</phrase><phrase role="special">::</phrase><phrase
- role="identifier">fifo</phrase> <phrase role="special">&gt;</phrase> <phrase
- role="special">&gt;</phrase></code>. The static instance of <code><phrase
+ For some applications it is convenient to bind the <emphasis>worker-threads</emphasis>
+ to processors/cores of the system. For this purpose <code><phrase role="identifier">bind_to_processors</phrase><phrase
+ role="special">()</phrase></code> must be given to constructor instead <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> contains as many <emphasis>worker-threads</emphasis>
- as <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
- role="identifier">thread</phrase><phrase role="special">::</phrase><phrase
- role="identifier">hardware_concurrency</phrase><phrase role="special">()</phrase></code>
- returns, queues unlimited amount of tasks and schedules the tasks in FIFO-order.
+ role="identifier">poolsize</phrase></code> so that a <emphasis>worker-thread</emphasis>
+ is created an bound the the core.
       </para>
       <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>
-<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">&lt;=</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">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;worker-threads running in default-pool == &quot;</phrase> <phrase role="special">&lt;&lt;</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">size</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
+<programlisting><phrase role="keyword">typedef</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">tp</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="special">&gt;</phrase> <phrase role="identifier">pool_type</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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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_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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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_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">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h1</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(5) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h2</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
-<phrase role="special">}</phrase>
+<phrase role="comment">// constructs thread-pool with worker-threads as
+</phrase><phrase role="comment">// CPUs/Cores are available on the system
+</phrase><phrase role="identifier">pool_type</phrase> <phrase role="identifier">pool</phrase><phrase role="special">(</phrase> <phrase role="identifier">pool_type</phrase><phrase role="special">::</phrase><phrase role="identifier">bind_to_processors</phrase><phrase role="special">()</phrase> <phrase role="special">);</phrase>
 </programlisting>
       </para>
- </section>
- <section id="boost_task.pool.processor_binding">
- <title><link linkend="boost_task.pool.processor_binding"> Processor binding</link></title>
- <para>
- For some applications it is convenient to bind the <emphasis>worker-threads</emphasis>
- to processors/cores of the system. For this purpose <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>
- must not be given to the constructor so that a <emphasis>worker-thread</emphasis>
- is created an bound the the core.
- </para>
- <para>
-
-<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">tp</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase> <phrase role="special">&gt;</phrase>
-<phrase role="special">&gt;</phrase> <phrase role="identifier">pool</phrase><phrase role="special">;</phrase> <phrase role="comment">// constructs thread-pool with worker-threads as hardware_concurrency() returns
-</phrase></programlisting>
- </para>
       <para>
- The constructor takes additional arguments for the link_work_stealing[work-stealing
- algorithm] and link_channel[high-] and link_channel[low-watermark] too.
+ The constructor takes additional arguments for the <link linkend="boost_task.pool.work_stealing">work-stealing
+ algorithm</link> and <link linkend="boost_task.pool.channel">high-</link>
+ and <link linkend="boost_task.pool.channel">low-watermark</link> too.
       </para>
       <note>
         <para>
           <emphasis role="bold">Boost.Task</emphasis> does provide this feature only
- for Windows, Linux, AIX, HP-UX and Solaris.
+ for Windows, Linux, AIX, HP-UX, Solaris and FreeBSD.
         </para>
       </note>
     </section>
@@ -2003,7 +2024,7 @@
         role="special">::</phrase><phrase role="identifier">task</phrase></code>
         is not proceeded in the join operation until the forked <emphasis>sub-tasks</emphasis>
         have completed. In the meantime the <emphasis>worker-thread</emphasis> executes
- other tasks from its local worker-queue.
+ other tasks from its local <emphasis>worker-queue</emphasis>.
       </para>
       <para>
         
@@ -2018,21 +2039,21 @@
         <phrase role="keyword">if</phrase> <phrase role="special">(</phrase> <phrase role="identifier">n</phrase> <phrase role="special">&lt;</phrase> <phrase role="identifier">cutof</phrase><phrase role="special">)</phrase> <phrase role="keyword">return</phrase> <phrase role="identifier">serial_fib</phrase><phrase role="special">(</phrase> <phrase role="identifier">n</phrase><phrase role="special">);</phrase>
         <phrase role="keyword">else</phrase>
         <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">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="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">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="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">// create a sub-task calculating fibonacci(n-1)
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t1</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="comment">// create a sub-task calculating fibonacci(n-2)
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t2</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="comment">// fork both sub-tasks by moving the task
+</phrase> <phrase role="comment">// ownership to the thread-pool
+</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t1</phrase><phrase role="special">)</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">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t2</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
@@ -2044,14 +2065,27 @@
 
 <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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">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 &lt; 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="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">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</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">static_pool</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">fifo</phrase>
+ <phrase role="special">&gt;</phrase>
+ <phrase role="special">&gt;</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="comment">// compute fibonacci-number 10
+</phrase> <phrase role="comment">// for numbers &lt; 5 do inline calculation
+</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</phrase><phrase role="special">(</phrase>
+ <phrase role="identifier">parallel_fib</phrase><phrase role="special">,</phrase>
+ <phrase role="number">10</phrase><phrase role="special">,</phrase>
+ <phrase role="number">5</phrase><phrase role="special">);</phrase>
+
+ <phrase role="comment">// move task ownership to thread-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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">move</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="special">);</phrase>
+
+ <phrase role="comment">// access result
+</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;fibonacci(10) == &quot;</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">.</phrase><phrase role="identifier">get</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</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>
@@ -2074,11 +2108,11 @@
     </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">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">h</phrase><phrase role="special">(</phrase>
+<programlisting><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">t</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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">long</phrase> <phrase role="special">&gt;</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">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="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">move</phrase><phrase role="special">(</phrase> <phrase role="identifier">t</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>
@@ -2199,13 +2233,19 @@
     </para>
     <para>
       
-<programlisting><phrase role="identifier">typdef</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
+<programlisting><phrase role="comment">// thread-pool with priority scheduling
+</phrase><phrase role="comment">// type of priority is int
+</phrase><phrase role="identifier">typdef</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">&lt;</phrase>
         <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">unbounded_channel</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">priority</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&gt;</phrase> <phrase role="comment">// pool with priority scheduling; integer as priority type
-</phrase><phrase role="special">&gt;</phrase> <phrase role="identifier">pool_type</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">priority</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">int</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="special">&gt;</phrase>
+<phrase role="special">&gt;</phrase> <phrase role="identifier">pool_type</phrase><phrase role="special">;</phrase>
+
+<phrase role="comment">// test if thread-pool supports priorities at compile time
+</phrase><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">has_attribute</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">pool_type</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">value</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
 
-<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">boolalpha</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase role="identifier">task</phrase><phrase role="special">::</phrase><phrase role="identifier">has_attribute</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">pool_type</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">value</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="string">&quot;\n&quot;</phrase><phrase role="special">;</phrase>
-<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="keyword">typeid</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">attribute_type</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">pool_type</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase><phrase role="special">).</phrase><phrase role="identifier">name</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
+<phrase role="comment">// access the type used for priority
+</phrase><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="keyword">typeid</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">attribute_type</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">pool_type</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase><phrase role="special">).</phrase><phrase role="identifier">name</phrase><phrase role="special">()</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">endl</phrase><phrase role="special">;</phrase>
 </programlisting>
     </para>
   </section>
@@ -2219,33 +2259,97 @@
 <programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
-<phrase role="keyword">class</phrase> <phrase role="identifier">task</phrase>
+<phrase role="keyword">class</phrase> <phrase role="identifier">task</phrase> <phrase role="special">:</phrase> <phrase role="keyword">private</phrase> <phrase role="identifier">noncopyable</phrase>
 <phrase role="special">{</phrase>
 <phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+ <phrase role="identifier">task</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">fn</phrase><phrase role="special">)());</phrase>
+
         <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Fn</phrase> <phrase role="special">&gt;</phrase>
- <phrase role="identifier">task</phrase><phrase role="special">(</phrase> <phrase role="identifier">Fn</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</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="identifier">fn</phrase><phrase role="special">);</phrase>
+
+ <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
+ <phrase role="identifier">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">&lt;</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">A9</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="identifier">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">A9</phrase> <phrase role="identifier">a9</phrase><phrase role="special">);</phrase>
 
- <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><phrase role="special">;</phrase>
+ <phrase role="identifier">task</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase> <phrase role="special">&amp;&amp;</phrase> <phrase role="identifier">t</phrase><phrase role="special">);</phrase>
+ <phrase role="identifier">task</phrase> <phrase role="special">&amp;</phrase> <phrase role="keyword">operator</phrase><phrase role="special">=(</phrase> <phrase role="identifier">task</phrase> <phrase role="special">&amp;&amp;</phrase> <phrase role="identifier">t</phrase><phrase role="special">);</phrase>
+ <phrase role="identifier">task</phrase> <phrase role="special">&amp;&amp;</phrase> <phrase role="identifier">move</phrase><phrase role="special">();</phrase>
 
         <phrase role="identifier">shared_future</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</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">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</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 role="keyword">void</phrase> <phrase role="keyword">operator</phrase><phrase role="special">()();</phrase>
 
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
-<phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase> <phrase role="special">&gt;</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="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Cb</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="keyword">void</phrase> <phrase role="identifier">set_wait_callback</phrase><phrase role="special">(</phrase> <phrase role="identifier">Cb</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</phrase> <phrase role="identifier">cb</phrase><phrase role="special">);</phrase>
 
-<phrase role="special">...</phrase>
+ <phrase role="keyword">void</phrase> <phrase role="identifier">swap</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="special">&amp;</phrase> <phrase role="identifier">other</phrase><phrase role="special">);</phrase>
 
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
-<phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase> <phrase role="special">&gt;</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>
+ <phrase role="keyword">operator</phrase> <phrase role="identifier">unspecified_bool_type</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase><phrase role="special">;</phrase>
+ <phrase role="keyword">bool</phrase> <phrase role="keyword">operator</phrase><phrase role="special">!()</phrase> <phrase role="keyword">const</phrase><phrase role="special">;</phrase>
+<phrase role="special">};</phrase>
 </programlisting>
       </para>
- <anchor id="boost_task.reference.task.constructor"/>
+ <anchor id="boost_task.reference.task.default_constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.default_constructor">Default constructor</link>
+ </bridgehead>
+
+<programlisting><phrase role="identifier">task</phrase><phrase role="special">()</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs an unitialized <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</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></code>
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.constructor__function_pointer_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.constructor__function_pointer_">Constructor
+ (function pointer)</link>
+ </bridgehead>
+
+<programlisting><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">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">task</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></code>
+ from a function pointer
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.constructor__functor_"/>
       <bridgehead renderas="sect4">
- <link linkend="boost_task.reference.task.constructor">Constructor</link>
+ <link linkend="boost_task.reference.task.constructor__functor_">Constructor
+ (functor)</link>
       </bridgehead>
       
 <programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Fn</phrase> <phrase role="special">&gt;</phrase>
@@ -2256,7 +2360,7 @@
         <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">task</phrase><phrase role="special">&lt;</phrase>
             <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase></code>
             from a function object
@@ -2270,19 +2374,104 @@
         </listitem>
         </varlistentry>
       </variablelist>
- <anchor id="boost_task.reference.task.function__code__phrase_role__identifier__get_id__phrase__phrase_role__special______phrase___code_"/>
+ <anchor id="boost_task.reference.task.constructor__functor_with_arguments_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.constructor__functor_with_arguments_">Constructor
+ (functor with arguments)</link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
+<phrase role="identifier">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">&lt;</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">A9</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="identifier">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">A9</phrase> <phrase role="identifier">a9</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</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase></code>
+ from a function object and its arguments
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.move_copy_constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.move_copy_constructor">Move-copy
+ constructor</link>
+ </bridgehead>
+
+<programlisting><phrase role="identifier">task</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase> <phrase role="special">&amp;&amp;)</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</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase></code>
+ from another task taking over the ownership
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.move_assignment_operator"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.move_assignment_operator">Move-assignment
+ operator</link>
+ </bridgehead>
+
+<programlisting><phrase role="identifier">task</phrase> <phrase role="special">&amp;</phrase> <phrase role="keyword">operator</phrase><phrase role="special">=(</phrase> <phrase role="identifier">task</phrase> <phrase role="special">&amp;&amp;)</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</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase></code>
+ from another task taking over the ownership
+ </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__move__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>
+ <link linkend="boost_task.reference.task.member_function__code__phrase_role__identifier__move__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">move</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><phrase role="identifier">task</phrase> <phrase role="special">&amp;&amp;</phrase> <phrase role="identifier">move</phrase><phrase role="special">()</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- returns task identifier
+ moves task releasing the ownership
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
@@ -2311,15 +2500,67 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- ???
+ Nothing
           </para>
         </listitem>
         </varlistentry>
       </variablelist>
- <anchor id="boost_task.reference.task.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_"/>
+ <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__identifier__swap__phrase__phrase_role__special______phrase___code_">Member
- function <code><phrase role="identifier">swap</phrase><phrase role="special">()</phrase></code></link>
+ <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 task's internal function object
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.task.member_template_function__code__phrase_role__identifier__set_wait_callback__phrase__phrase_role__special_____phrase___phrase_role__identifier__cb__phrase___phrase_role__identifier__cons__phrase__phrase_role__special___amp____phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.member_template_function__code__phrase_role__identifier__set_wait_callback__phrase__phrase_role__special_____phrase___phrase_role__identifier__cb__phrase___phrase_role__identifier__cons__phrase__phrase_role__special___amp____phrase___code_">Member
+ template-function <code><phrase role="identifier">set_wait_callback</phrase><phrase
+ role="special">(</phrase> <phrase role="identifier">Cb</phrase> <phrase role="identifier">cons</phrase><phrase
+ role="special">&amp;)</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Cb</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="keyword">void</phrase> <phrase role="identifier">set_wait_callback</phrase><phrase role="special">(</phrase> <phrase role="identifier">Cb</phrase> <phrase role="keyword">const</phrase> <phrase role="identifier">cb</phrase><phrase role="special">&amp;);</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ stores callback function object which will be called if task would block
+ </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__swap__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__special___amp____phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.task.member_function__code__phrase_role__identifier__swap__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__special___amp____phrase___code_">Member
+ function <code><phrase role="identifier">swap</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="special">&amp;)</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">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">other</phrase><phrase role="special">)</phrase>
@@ -2339,19 +2580,20 @@
         </listitem>
         </varlistentry>
       </variablelist>
- <anchor id="boost_task.reference.task.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special________phrase___code_"/>
+ <anchor id="boost_task.reference.task.operator__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__unspecified_bool_type__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>
+ <link linkend="boost_task.reference.task.operator__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__unspecified_bool_type__phrase__phrase_role__special______phrase___code_">operator
+ <code><phrase role="keyword">operator</phrase> <phrase role="identifier">unspecified_bool_type</phrase><phrase
+ role="special">()</phrase></code></link>
       </bridgehead>
       
-<programlisting><phrase role="keyword">void</phrase> <phrase role="keyword">operator</phrase><phrase role="special">()()</phrase>
+<programlisting><phrase role="keyword">operator</phrase> <phrase role="identifier">unspecified_bool_type</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- executes tasks internal function object
+ is task valid == does task own ownership
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
@@ -2362,25 +2604,19 @@
         </listitem>
         </varlistentry>
       </variablelist>
- <anchor id="boost_task.reference.task.free_function__code__phrase_role__identifier__make_task__phrase__phrase_role__special______phrase___code_"/>
+ <anchor id="boost_task.reference.task.operator__code__phrase_role__keyword__operator__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>
+ <link linkend="boost_task.reference.task.operator__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___code_">operator
+ <code><phrase role="keyword">operator</phrase><phrase role="special">!()</phrase></code></link>
       </bridgehead>
       
-<programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
-<phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase> <phrase role="special">&gt;</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">&lt;</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">&gt;</phrase>
-<phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase> <phrase role="special">&gt;</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><phrase role="keyword">bool</phrase> <phrase role="keyword">operator</phrase><phrase role="special">!()</phrase> <phrase role="keyword">const</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- creates an task from function object and arguments
+ is task invalid == task does not have ownership
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
@@ -2404,27 +2640,17 @@
 <phrase role="special">{</phrase>
         <phrase role="identifier">handle</phrase><phrase role="special">();</phrase>
 
- <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><phrase role="special">;</phrase>
-
         <phrase role="keyword">void</phrase> <phrase role="identifier">interrupt</phrase><phrase role="special">();</phrase>
-
         <phrase role="keyword">void</phrase> <phrase role="identifier">interrupt_and_wait</phrase><phrase role="special">();</phrase>
-
         <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">&amp;</phrase> <phrase role="identifier">abs_time</phrase><phrase role="special">);</phrase>
-
         <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Duration</phrase> <phrase role="special">&gt;</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">&amp;</phrase> <phrase role="identifier">rel_time</phrase><phrase role="special">);</phrase>
-
         <phrase role="keyword">bool</phrase> <phrase role="identifier">interruption_requested</phrase><phrase role="special">();</phrase>
 
         <phrase role="identifier">R</phrase> <phrase role="identifier">get</phrase><phrase role="special">();</phrase>
-
         <phrase role="keyword">bool</phrase> <phrase role="identifier">is_ready</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase><phrase role="special">;</phrase>
-
         <phrase role="keyword">bool</phrase> <phrase role="identifier">has_value</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase><phrase role="special">;</phrase>
-
         <phrase role="keyword">bool</phrase> <phrase role="identifier">has_exception</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase><phrase role="special">;</phrase>
-
         <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">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">get_future</phrase><phrase role="special">();</phrase>
@@ -2437,13 +2663,7 @@
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
-
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
-
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <p
hrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
-
+<phrase role="special">...</phrase>
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <p
hrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
 
@@ -2452,13 +2672,7 @@
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
-
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
-
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase
><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
-
+<phrase role="special">...</phrase>
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase
><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
 </programlisting>
@@ -2485,29 +2699,6 @@
         </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>
       <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
@@ -2550,7 +2741,7 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- ???
+ Nothing
           </para>
         </listitem>
         </varlistentry>
@@ -2574,7 +2765,8 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- ???
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -2586,7 +2778,7 @@
         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">&amp;</phrase> <phrase role="identifier">abs_time</phrase><phrase role="special">)</phrase>
+<programlisting><phrase role="keyword">bool</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">&amp;</phrase> <phrase role="identifier">abs_time</phrase><phrase role="special">)</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
@@ -2596,10 +2788,17 @@
             or time-point elapsed
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Returns:</term>
+ <listitem>
+ <para>
+ false if the the time specified by abs_time was reached, true otherwise
+ </para>
+ </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- ???
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -2612,7 +2811,7 @@
       </bridgehead>
       
 <programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Duration</phrase> <phrase role="special">&gt;</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">&amp;</phrase> <phrase role="identifier">rel_time</phrase><phrase role="special">)</phrase>
+<phrase role="keyword">bool</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">&amp;</phrase> <phrase role="identifier">rel_time</phrase><phrase role="special">)</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
@@ -2622,10 +2821,17 @@
             or time-duration elapsed
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Returns:</term>
+ <listitem>
+ <para>
+ false if the the time specified by rel_time was reached, true otherwise
+ </para>
+ </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- ???
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -2648,7 +2854,16 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- task_interrupted, task_uninialized
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_interrupted</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task_uninialized</phrase></code>,
+ <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>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">broken_task</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -2671,7 +2886,81 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- task_interrupted, task_uninialized
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_interrupted</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task_uninialized</phrase></code>,
+ <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>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">broken_task</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait_for__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait_for__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">wait_for</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Duration</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="keyword">bool</phrase> <phrase role="identifier">wait_for</phrase><phrase role="special">(</phrase> <phrase role="identifier">Duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</phrase> <phrase role="identifier">rel_time</phrase><phrase role="special">)</phrase> <phrase role="keyword">const</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>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_interrupted</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task_uninialized</phrase></code>,
+ <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>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">broken_task</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait_until__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait_until__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">wait_until</phrase><phrase role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">bool</phrase> <phrase role="identifier">wait_until</phrase><phrase role="special">(</phrase> <phrase role="identifier">system_time</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</phrase> <phrase role="identifier">abs_time</phrase><phrase role="special">)</phrase> <phrase role="keyword">const</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>
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_interrupted</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task_uninialized</phrase></code>,
+ <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>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">broken_task</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -2798,19 +3087,19 @@
       </bridgehead>
       
 <programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="special">&gt;</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">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">&lt;</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">&gt;</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">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
+<phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
+<phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <p
hrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
+<phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <ph
rase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <p
hrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
+<phrase role="keyword">void</phrase> <phrase role="identifier">waitfor_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <ph
rase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
@@ -2822,7 +3111,11 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_interrupted</phrase></code>, <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>
@@ -2834,19 +3127,19 @@
       </bridgehead>
       
 <programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Iterator</phrase> <phrase role="special">&gt;</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="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">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">);</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">);</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase
><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <
phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">);</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase
><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</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">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t1</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t2</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t3</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <
phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t4</phrase><phrase role="special">,</phrase> <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">t5</phrase><phrase role="special">);</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
@@ -2858,7 +3151,13 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task_interrupted</phrase></code>, <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>,
+ <code><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">bad_alloc</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -2867,28 +3166,30 @@
     <section id="boost_task.reference.async">
       <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">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;,</phrase>
- <phrase role="identifier">EP</phrase><phrase role="special">)</phrase></code></link></title>
+ role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="special">&amp;&amp;,</phrase> <phrase role="identifier">EP</phrase><phrase
+ role="special">)</phrase></code></link></title>
       <para>
         
 <programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</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">&gt;</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
-<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">async</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> <phrase role="identifier">EP</phrase> <phrase role="identifier">ep</phrase><phrase role="special">);</phrase>
+<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">async</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="special">&amp;&amp;</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
+ moves task to an asyncrounous executer and returns a handle associated
             with the task
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -2897,30 +3198,32 @@
     <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">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;,</phrase>
- <phrase role="identifier">pool</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase>
- <phrase role="special">&amp;)</phrase></code></link></title>
+ role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="special">&amp;&amp;,</phrase> <phrase role="identifier">pool</phrase><phrase
+ role="special">&lt;</phrase> <phrase role="identifier">Channel</phrase> <phrase
+ role="special">&gt;</phrase> <phrase role="special">&amp;)</phrase></code></link></title>
       <para>
         
 <programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</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">&gt;</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
-<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">async</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> <phrase role="identifier">pool</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">ep</phrase><phrase role="special">);</phrase>
+<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">async</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="special">&amp;&amp;</phrase> <phrase role="identifier">t</phrase><phrase role="special">,</phrase> <phrase role="identifier">pool</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</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
+ moves task into a thread-pool and returns a handle associated with the
             task
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <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>
@@ -2929,31 +3232,33 @@
     <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">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;,</phrase>
- <phrase role="identifier">Attr</phrase><phrase role="special">,</phrase> <phrase
- role="identifier">pool</phrase><phrase role="special">&lt;</phrase> <phrase
- role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase> <phrase
- role="special">&amp;)</phrase></code></link></title>
+ role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="special">&amp;&amp;,</phrase> <phrase role="identifier">Attr</phrase><phrase
+ role="special">,</phrase> <phrase role="identifier">pool</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="special">&amp;)</phrase></code></link></title>
       <para>
         
 <programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</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">&gt;</phrase>
 
 <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
-<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">async</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> <phrase role="identifier">Attr</phrase> <phrase role="identifier">attr</phrase><phrase role="special">,</phrase> <phrase role="identifier">pool</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">ep</phrase><phrase role="special">);</phrase>
+<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">async</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="special">&amp;&amp;</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">&lt;</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;</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
+ moves attributed task into a thread-pool and returns a handle associated
             with the task
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <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>
@@ -2969,27 +3274,27 @@
 <phrase role="keyword">struct</phrase> <phrase role="identifier">own_thread</phrase>
 <phrase role="special">{</phrase>
         <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
- <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <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>
+ <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <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="special">&amp;&amp;</phrase> <phrase role="identifier">t</phrase><phrase role="special">);</phrase>
 <phrase role="special">};</phrase>
 </programlisting>
       </para>
- <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_"/>
+ <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__special___amp__amp____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
+ <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__special___amp__amp____phrase___code_">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></link>
+ <phrase role="special">&amp;&amp;)</phrase></code></link>
       </bridgehead>
       
 <programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
-<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <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>
+<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <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="special">&amp;&amp;</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
+ moves task in the current thread an returns an handle associated with
             the task
           </para>
         </listitem>
@@ -3012,34 +3317,34 @@
 <phrase role="keyword">struct</phrase> <phrase role="identifier">new_thread</phrase>
 <phrase role="special">{</phrase>
         <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
- <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <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>
+ <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <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="special">&amp;&amp;);</phrase>
 <phrase role="special">};</phrase>
 </programlisting>
       </para>
- <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_"/>
+ <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__special___amp__amp____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
+ <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__special___amp__amp____phrase___code_">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></link>
+ <phrase role="special">&amp;&amp;)</phrase></code></link>
       </bridgehead>
       
 <programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
-<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <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>
+<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <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="special">&amp;&amp;</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
+ moves task in a new thread an returns an handle associated with the task
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -3050,62 +3355,103 @@
       role="identifier">static_pool</phrase></code></link></title>
       <para>
         
-<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+<programlisting> <phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
 
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase>
-<phrase role="keyword">class</phrase> <phrase role="identifier">static_pool</phrase> <phrase role="special">:</phrase> <phrase role="keyword">private</phrase> <phrase role="identifier">noncopyable</phrase>
-<phrase role="special">{</phrase>
-<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
- <phrase role="keyword">explicit</phrase> <phrase role="identifier">pool</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">poolsize</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</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">&amp;</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">&amp;</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>
-
- <phrase role="keyword">explicit</phrase> <phrase role="identifier">pool</phrase><phrase role="special">(</phrase>
- <phrase role="identifier">poolsize</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</phrase> <phrase role="identifier">psize</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>
- <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>
- <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</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">&amp;</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>
-
-
- <phrase role="keyword">explicit</phrase> <phrase role="identifier">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">&amp;</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">&amp;</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>
-
- <phrase role="keyword">explicit</phrase> <phrase role="identifier">pool</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>
- <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>
- <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</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">&amp;</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>
-
- <phrase role="special">~</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">();</phrase>
-
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">size</phrase><phrase role="special">();</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">active</phrase><phrase role="special">();</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">idle</phrase><phrase role="special">();</phrase>
-
- <phrase role="keyword">void</phrase> <phrase role="identifier">shutdown</phrase><phrase role="special">();</phrase>
- <phrase role="keyword">void</phrase> <phrase role="identifier">shutdown_now</phrase><phrase role="special">();</phrase>
-
- <phrase role="keyword">bool</phrase> <phrase role="identifier">closed</phrase><phrase role="special">();</phrase>
- <phrase role="keyword">void</phrase> <phrase role="identifier">clear</phrase><phrase role="special">();</phrase>
- <phrase role="keyword">bool</phrase> <phrase role="identifier">empty</phrase><phrase role="special">();</phrase>
- <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">pending</phrase><phrase role="special">();</phrase>
-
- <phrase role="keyword">const</phrase> <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>
- <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">&amp;</phrase> <phrase role="identifier">hwm</phrase><phrase role="special">);</phrase>
- <phrase role="keyword">const</phrase> <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>
- <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">&amp;</phrase> <phrase role="identifier">lwm</phrase><phrase role="special">);</phrase>
+ <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Channel</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="keyword">class</phrase> <phrase role="identifier">static_pool</phrase> <phrase role="special">:</phrase> <phrase role="keyword">private</phrase> <phrase role="identifier">noncopyable</phrase>
+ <phrase role="special">{</phrase>
+ <phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+ <phrase role="identifier">static_pool</phrase><phrase role="special">();</phrase>
 
- <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
- <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">submit</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>
+ <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">&amp;</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">&amp;</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">&amp;</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>
+
+ <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">&amp;</phrase> <phrase role="identifier">psize</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>
+ <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>
+ <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</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">&amp;</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>
+
+ <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase> <phrase role="identifier">static_pool</phrase> <phrase role="special">&amp;&amp;);</phrase>
+
+ <phrase role="identifier">static_pool</phrase> <phrase role="special">&amp;</phrase> <phrase role="keyword">operator</phrase><phrase role="special">=(</phrase> <phrase role="identifier">static_pool</phrase> <phrase role="special">&amp;&amp;);</phrase>
+
+<phrase role="preprocessor"># if</phrase> <phrase role="identifier">defined</phrase><phrase role="special">(</phrase><phrase role="identifier">BOOST_HAS_PROCESSOR_BINDINGS</phrase><phrase role="special">)</phrase>
+ <phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
+ <phrase role="special">&lt;&lt;</phrase><phrase role="identifier">unspec</phrase><phrase role="special">-</phrase><phrase role="identifier">type</phrase><phrase role="special">&gt;&gt;,</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">&amp;</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">&amp;</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>
+
+ <phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
+ <phrase role="special">&lt;&lt;</phrase><phrase role="identifier">unspec</phrase><phrase role="special">-</phrase><phrase role="identifier">type</phrase><phrase role="special">&gt;&gt;,</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>
+ <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>
+ <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</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">&amp;</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>
+
+ <phrase role="keyword">static</phrase> <phrase role="special">&lt;&lt;</phrase><phrase role="identifier">unspec</phrase><phrase role="special">-</phrase><phrase role="identifier">type</phrase><phrase role="special">&gt;&gt;</phrase> <phrase role="identifier">bind_to_processors</phrase><phrase role="special">();</phrase>
+<phrase role="preprocessor"># endif</phrase>
 
- <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
- <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">submit</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> <phrase role="identifier">Attr</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</phrase> <phrase role="identifier">attr</phrase><phrase role="special">);</phrase>
-<phrase role="special">};</phrase>
+ <phrase role="special">~</phrase><phrase role="identifier">static_pool</phrase><phrase role="special">();</phrase>
+
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">size</phrase><phrase role="special">();</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">active</phrase><phrase role="special">();</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">idle</phrase><phrase role="special">();</phrase>
+
+ <phrase role="keyword">void</phrase> <phrase role="identifier">shutdown</phrase><phrase role="special">();</phrase>
+ <phrase role="keyword">void</phrase> <phrase role="identifier">shutdown_now</phrase><phrase role="special">();</phrase>
+
+ <phrase role="keyword">void</phrase> <phrase role="identifier">interrupt_all_worker</phrase><phrase role="special">();</phrase>
+
+ <phrase role="keyword">bool</phrase> <phrase role="identifier">closed</phrase><phrase role="special">();</phrase>
+ <phrase role="keyword">void</phrase> <phrase role="identifier">clear</phrase><phrase role="special">();</phrase>
+ <phrase role="keyword">bool</phrase> <phrase role="identifier">empty</phrase><phrase role="special">();</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">size_t</phrase> <phrase role="identifier">pending</phrase><phrase role="special">();</phrase>
+
+ <phrase role="keyword">const</phrase> <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>
+ <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">&amp;</phrase> <phrase role="identifier">hwm</phrase><phrase role="special">);</phrase>
+ <phrase role="keyword">const</phrase> <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>
+ <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">&amp;</phrase> <phrase role="identifier">lwm</phrase><phrase role="special">);</phrase>
+
+ <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">submit</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="special">&amp;&amp;</phrase> <phrase role="identifier">t</phrase><phrase role="special">);</phrase>
+
+ <phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
+ <phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">submit</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="special">&amp;&amp;</phrase> <phrase role="identifier">t</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>
+
+ <phrase role="keyword">void</phrase> <phrase role="identifier">swap</phrase><phrase role="special">(</phrase> <phrase role="identifier">static_pool</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">other</phrase><phrase role="special">);</phrase>
+
+ <phrase role="keyword">operator</phrase> <phrase role="identifier">unspecified_bool_type</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase><phrase role="special">;</phrase>
+ <phrase role="keyword">bool</phrase> <phrase role="keyword">operator</phrase><phrase role="special">!()</phrase> <phrase role="keyword">const</phrase><phrase role="special">;</phrase>
+ <phrase role="special">};</phrase>
 </programlisting>
       </para>
+ <anchor id="boost_task.reference.static_pool.default_constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.default_constructor">Default
+ constructor</link>
+ </bridgehead>
+
+<programlisting><phrase role="identifier">static_pool</phrase><phrase role="special">()</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ constructs an unitialized pool
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
       <anchor id="boost_task.reference.static_pool.constructor__unbounded_channel_"/>
       <bridgehead renderas="sect4">
         <link linkend="boost_task.reference.static_pool.constructor__unbounded_channel_">Constructor
@@ -3113,6 +3459,7 @@
       </bridgehead>
       
 <programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
+ <phrase role="special">&lt;&lt;</phrase><phrase role="identifier">unspec</phrase><phrase role="special">-</phrase><phrase role="identifier">type</phrase><phrase role="special">&gt;&gt;,</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">&amp;</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">&amp;</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>
@@ -3120,7 +3467,7 @@
         <title></title> <varlistentry><term>Preconditions:</term>
         <listitem>
           <para>
- operating system provides functionality for processor pining
+ operating system provides functionality for processor binding
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Effects:</term>
@@ -3135,6 +3482,8 @@
         <listitem>
           <para>
             <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</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_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
             role="special">::</phrase><phrase role="identifier">task</phrase><phrase
@@ -3144,7 +3493,9 @@
         </varlistentry> <varlistentry><term>Notes:</term>
         <listitem>
           <para>
- constructor has to be called if a unbounded-channel is used
+ constructor has to be called if a unbounded-channel is used and <code><phrase
+ role="identifier">bind_to_processors</phrase><phrase role="special">()</phrase></code>
+ must be set as first argument
           </para>
         </listitem>
         </varlistentry>
@@ -3172,6 +3523,8 @@
         <listitem>
           <para>
             <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</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_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
             role="special">::</phrase><phrase role="identifier">task</phrase><phrase
@@ -3193,6 +3546,7 @@
       </bridgehead>
       
 <programlisting><phrase role="keyword">explicit</phrase> <phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase>
+ <phrase role="special">&lt;&lt;</phrase><phrase role="identifier">unspec</phrase><phrase role="special">-</phrase><phrase role="identifier">type</phrase><phrase role="special">&gt;&gt;,</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>
         <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>
         <phrase role="identifier">posix_time</phrase><phrase role="special">::</phrase><phrase role="identifier">time_duration</phrase> <phrase role="keyword">const</phrase><phrase role="special">&amp;</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>
@@ -3202,7 +3556,7 @@
         <title></title> <varlistentry><term>Preconditions:</term>
         <listitem>
           <para>
- operating system provides functionality for processor pining
+ operating system provides functionality for processor binding
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Effects:</term>
@@ -3217,6 +3571,8 @@
         <listitem>
           <para>
             <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</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_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
             role="special">::</phrase><phrase role="identifier">task</phrase><phrase
@@ -3229,7 +3585,9 @@
         </varlistentry> <varlistentry><term>Notes:</term>
         <listitem>
           <para>
- Constructor has to be called if a bounded-channel is used.
+ constructor has to be called if a bounded-channel is used and <code><phrase
+ role="identifier">bind_to_processors</phrase><phrase role="special">()</phrase></code>
+ must be set as first argument
           </para>
         </listitem>
         </varlistentry>
@@ -3259,6 +3617,8 @@
         <listitem>
           <para>
             <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_resource_error</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_scanns</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
             role="special">::</phrase><phrase role="identifier">task</phrase><phrase
@@ -3276,6 +3636,52 @@
         </listitem>
         </varlistentry>
       </variablelist>
+ <anchor id="boost_task.reference.static_pool.move_copy_constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.move_copy_constructor">Move-copy
+ constructor</link>
+ </bridgehead>
+
+<programlisting><phrase role="identifier">static_pool</phrase><phrase role="special">(</phrase> <phrase role="identifier">static_pool</phrase> <phrase role="special">&amp;&amp;)</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ creates an pool out of another one which gets zeroed out
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.move_assigment_constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.move_assigment_constructor">Move-assigment
+ constructor</link>
+ </bridgehead>
+
+<programlisting><phrase role="identifier">static_pool</phrase> <phrase role="special">&amp;</phrase> <phrase role="keyword">operator</phrase><phrase role="special">=(</phrase> <phrase role="identifier">static_pool</phrase> <phrase role="special">&amp;&amp;)</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ creates an pool out of another one which gets zeroed out
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ nothing
+ </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>
@@ -3287,14 +3693,39 @@
         <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
+ calls <code><phrase role="identifier">shutdown</phrase><phrase role="special">()</phrase></code>
+ if not already called
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.static_member_function__code__phrase_role__identifier__bind_to_processors__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.static_member_function__code__phrase_role__identifier__bind_to_processors__phrase__phrase_role__special______phrase___code_">Static
+ member function <code><phrase role="identifier">bind_to_processors</phrase><phrase
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="special">&lt;&lt;</phrase><phrase role="identifier">unspec</phrase><phrase role="special">-</phrase><phrase role="identifier">type</phrase><phrase role="special">&gt;&gt;</phrase> <phrase role="identifier">bind_to_processors</phrase><phrase role="special">()</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ used in order to let the pool create worker-threads as cores are available
+ and bound the threads to the cores
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ nothing
           </para>
         </listitem>
         </varlistentry>
@@ -3317,7 +3748,9 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -3340,7 +3773,9 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -3363,13 +3798,15 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Notes:</term>
         <listitem>
           <para>
- The value is the difference of <code><phrase role="identifier">size</phrase><phrase
+ 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>
@@ -3394,7 +3831,13 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_interrupted</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">system</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">system_error</phrase></code>,
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Notes:</term>
@@ -3424,7 +3867,13 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_interrupted</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">system</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">system_error</phrase></code>,
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Notes:</term>
@@ -3435,6 +3884,30 @@
         </listitem>
         </varlistentry>
       </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__interrupt_all_worker__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__interrupt_all_worker__phrase__phrase_role__special______phrase___code_">Member
+ function <code><phrase role="identifier">interrupt_all_worker</phrase><phrase
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">interrupt_all_worker</phrase><phrase role="special">()</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ interrupts all worker-threads without invalidating 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__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
@@ -3453,7 +3926,9 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -3476,7 +3951,9 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -3499,7 +3976,9 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -3523,7 +4002,9 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry>
@@ -3552,7 +4033,9 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Notes:</term>
@@ -3600,7 +4083,9 @@
           <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>
+ role="identifier">invalid_watermark</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Notes:</term>
@@ -3635,7 +4120,9 @@
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Notes:</term>
@@ -3683,7 +4170,9 @@
           <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>
+ role="identifier">invalid_watermark</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">pool_moved</phrase></code>
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Notes:</term>
@@ -3694,17 +4183,17 @@
         </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_"/>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__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__special___amp__amp____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
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__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__special___amp__amp____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">&amp;</phrase> <phrase role="identifier">act</phrase><phrase
- role="special">)</phrase></code></link>
+ <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="special">&amp;&amp;)</phrase></code></link>
       </bridgehead>
       
 <programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
-<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">submit</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="keyword">const</phrase><phrase role="special">&amp;</phrase> <phrase role="identifier">t</phrase><phrase role="special">)</phrase>
+<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">submit</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="special">&amp;&amp;</phrase> <phrase role="identifier">t</phrase><phrase role="special">)</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Preconditions:</term>
@@ -3716,7 +4205,7 @@
         </varlistentry> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- submits an task to the pool and returns an associated handle
+ moves an task to the pool and returns an associated handle
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
@@ -3724,24 +4213,26 @@
           <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>
+ role="identifier">task_rejected</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">pool_moved</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_"/>
+ <anchor id="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__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__special___amp__amp____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
+ <link linkend="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__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__special___amp__amp____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">&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></link>
- </bridgehead>
+ <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase>
+ <phrase role="special">&amp;&amp;,</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></link>
+ </bridgehead>
       
 <programlisting><phrase role="keyword">template</phrase><phrase role="special">&lt;</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">&gt;</phrase>
-<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">submit</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="keyword">const</phrase><phrase role="special">&amp;</phrase> <phrase role="identifier">t</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>
+<phrase role="identifier">handle</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">R</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">submit</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="special">&amp;&amp;</phrase> <phrase role="identifier">t</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>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Preconditions:</term>
@@ -3753,7 +4244,7 @@
         </varlistentry> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- submits an task to the pool and returns an associated handle - task is
+ moves an task to the pool and returns an associated handle - task is
             scheduled by the attribute
           </para>
         </listitem>
@@ -3762,7 +4253,79 @@
           <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>
+ role="identifier">task_rejected</phrase></code>, <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">pool_moved</phrase></code>
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.member_function_swap__static_pool__amp___"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.member_function_swap__static_pool__amp___">Member
+ function swap( static_pool &amp;)`</link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">void</phrase> <phrase role="identifier">swap</phrase><phrase role="special">(</phrase> <phrase role="identifier">static_pool</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">other</phrase><phrase role="special">)</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ swaps pool
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.operator__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__unspecified_bool_type__phrase__phrase_role__special______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.operator__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__unspecified_bool_type__phrase__phrase_role__special______phrase___code_">operator
+ <code><phrase role="keyword">operator</phrase> <phrase role="identifier">unspecified_bool_type</phrase><phrase
+ role="special">()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">operator</phrase> <phrase role="identifier">unspecified_bool_type</phrase><phrase role="special">()</phrase> <phrase role="keyword">const</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ is static_pool valid == does static_pool own ownership
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <anchor id="boost_task.reference.static_pool.operator__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___code_"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.static_pool.operator__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___code_">operator
+ <code><phrase role="keyword">operator</phrase><phrase role="special">!()</phrase></code></link>
+ </bridgehead>
+
+<programlisting><phrase role="keyword">bool</phrase> <phrase role="keyword">operator</phrase><phrase role="special">!()</phrase> <phrase role="keyword">const</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ is static_pool invalid == static_pool does not have ownership
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Nothing
           </para>
         </listitem>
         </varlistentry>
@@ -3786,21 +4349,20 @@
             reschedules current task until passed callable predicate becomes ready
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
+ <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">thread_interrupted</phrase></code>,<code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">system</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">system_error</phrase></code>
           </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>.
+ 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>
@@ -3825,21 +4387,17 @@
             is executed
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
+ 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>.
+ 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>
@@ -3862,21 +4420,17 @@
             returns true if the current task is executed in a thread-pool
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
+ 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>.
+ 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>
@@ -3899,21 +4453,17 @@
             returns returns the thread-id of the worker-thread
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
+ 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>.
+ 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>
@@ -3940,21 +4490,17 @@
             process another task in the meantime
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
+ 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>.
+ 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>
@@ -3978,21 +4524,17 @@
             task in the meantime
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- [Throws:
- </para>
- </listitem>
- <listitem>
- <para>
- Nothing.
+ 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>.
+ 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>
@@ -4015,59 +4557,379 @@
             task can request interruption for itself
           </para>
         </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <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
+ role="identifier">has_attribute</phrase></code></link></title>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">meta</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="keyword">struct</phrase> <phrase role="identifier">has_attribute</phrase> <phrase role="special">:</phrase> <phrase role="keyword">public</phrase> <phrase role="identifier">mpl</phrase><phrase role="special">::</phrase><phrase role="identifier">bool_</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">is_same</phrase><phrase role="special">&lt;</phrase>
+ <phrase role="identifier">detail</phrase><phrase role="special">::</phrase><phrase role="identifier">has_priority</phrase><phrase role="special">,</phrase>
+ <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase><phrase role="special">::</phrase><phrase role="identifier">scheduler_type</phrase><phrase role="special">::</phrase><phrase role="identifier">priority_tag_type</phrase>
+ <phrase role="special">&gt;::</phrase><phrase role="identifier">value</phrase>
+<phrase role="special">&gt;</phrase>
+<phrase role="special">{};</phrase>
+</programlisting>
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns true if Pool supports attributes (priority-scheduling)
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ nothing
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.attribute_type">
+ <title><link linkend="boost_task.reference.attribute_type"> Meta function
+ <code><phrase role="identifier">attribute_type</phrase></code></link></title>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">meta</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+
+<phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="keyword">struct</phrase> <phrase role="identifier">attribute_type</phrase>
+<phrase role="special">{</phrase>
+ <phrase role="keyword">typedef</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase><phrase role="special">::</phrase><phrase role="identifier">scheduler_type</phrase><phrase role="special">::</phrase><phrase role="identifier">attribute_type</phrase> <phrase role="identifier">type</phrase><phrase role="special">;</phrase>
+<phrase role="special">};</phrase>
+</programlisting>
+ </para>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ returns type of attribute
+ </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>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</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="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+
+<phrase role="keyword">class</phrase> <phrase role="identifier">poolsize</phrase>
+<phrase role="special">{</phrase>
+<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+ <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>
+
+ <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><phrase role="special">;</phrase>
+<phrase role="special">};</phrase>
+</programlisting>
+ </para>
+ <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 &gt; 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 () &gt; 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>
+ </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>
+ <section id="boost_task.reference.high_watermark">
+ <title><link linkend="boost_task.reference.high_watermark"> Class <code><phrase
+ role="identifier">high_watermark</phrase></code></link></title>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">watermark</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+
+<phrase role="keyword">class</phrase> <phrase role="identifier">high_watermark</phrase>
+<phrase role="special">{</phrase>
+<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+ <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>
+
+ <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><phrase role="special">;</phrase>
+<phrase role="special">};</phrase>
+</programlisting>
+ </para>
+ <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>
+ <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>
+ </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>
- [Throws:
+ Nothing
           </para>
         </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_task.reference.low_watermark">
+ <title><link linkend="boost_task.reference.low_watermark"> Class <code><phrase
+ role="identifier">low_watermark</phrase></code></link></title>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">watermark</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+
+<phrase role="keyword">class</phrase> <phrase role="identifier">low_watermark</phrase>
+<phrase role="special">{</phrase>
+<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+ <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>
+
+ <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><phrase role="special">;</phrase>
+<phrase role="special">};</phrase>
+</programlisting>
+ </para>
+ <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>
+ <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>
+ </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>
+ <section id="boost_task.reference.scanns">
+ <title><link linkend="boost_task.reference.scanns"> Class <code><phrase role="identifier">scanns</phrase></code></link></title>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">scanns</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+
+<phrase role="keyword">class</phrase> <phrase role="identifier">scanns</phrase>
+<phrase role="special">{</phrase>
+<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+ <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>
+
+ <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><phrase role="special">;</phrase>
+<phrase role="special">};</phrase>
+</programlisting>
+ </para>
+ <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 &gt; 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 () &gt; 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>
+ </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>
- Nothing.
+ returns the value
           </para>
         </listitem>
- </varlistentry> <varlistentry><term>Note:</term>
+ </varlistentry> <varlistentry><term>Throws:</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>.
+ Nothing
           </para>
         </listitem>
         </varlistentry>
       </variablelist>
     </section>
- <section id="boost_task.reference.has_attribute">
- <title><link linkend="boost_task.reference.has_attribute"> Meta function <code><phrase
- role="identifier">has_attribute</phrase></code></link></title>
- <para>
-
-<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">meta</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
-
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase> <phrase role="special">&gt;</phrase>
-<phrase role="keyword">struct</phrase> <phrase role="identifier">has_attribute</phrase> <phrase role="special">:</phrase> <phrase role="keyword">public</phrase> <phrase role="identifier">mpl</phrase><phrase role="special">::</phrase><phrase role="identifier">bool_</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">is_same</phrase><phrase role="special">&lt;</phrase>
- <phrase role="identifier">detail</phrase><phrase role="special">::</phrase><phrase role="identifier">has_priority</phrase><phrase role="special">,</phrase>
- <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase><phrase role="special">::</phrase><phrase role="identifier">scheduler_type</phrase><phrase role="special">::</phrase><phrase role="identifier">priority_tag_type</phrase>
- <phrase role="special">&gt;::</phrase><phrase role="identifier">value</phrase>
-<phrase role="special">&gt;</phrase>
-<phrase role="special">{};</phrase>
-</programlisting>
- </para>
- </section>
- <section id="boost_task.reference.attribute_type">
- <title><link linkend="boost_task.reference.attribute_type"> Meta function
- <code><phrase role="identifier">attribute_type</phrase></code></link></title>
- <para>
-
-<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">meta</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
-
-<phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase> <phrase role="special">&gt;</phrase>
-<phrase role="keyword">struct</phrase> <phrase role="identifier">attribute_type</phrase>
-<phrase role="special">{</phrase>
- <phrase role="keyword">typedef</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Pool</phrase><phrase role="special">::</phrase><phrase role="identifier">scheduler_type</phrase><phrase role="special">::</phrase><phrase role="identifier">attribute_type</phrase> <phrase role="identifier">type</phrase><phrase role="special">;</phrase>
-<phrase role="special">};</phrase>
-</programlisting>
- </para>
- </section>
     <section id="boost_task.reference.invalid_poolsize">
       <title><link linkend="boost_task.reference.invalid_poolsize"> Class <code><phrase
       role="identifier">invalid_poolsize</phrase></code></link></title>
@@ -4093,15 +4955,15 @@
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ 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.
+ role="identifier">invalid_poolsize</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ nothing
           </para>
         </listitem>
         </varlistentry>
@@ -4121,9 +4983,10 @@
 <phrase role="special">};</phrase>
 </programlisting>
       </para>
- <para>
- heading Constructor]
- </para>
+ <anchor id="boost_task.reference.invalid_scanns.constructor"/>
+ <bridgehead renderas="sect4">
+ <link linkend="boost_task.reference.invalid_scanns.constructor">Constructor</link>
+ </bridgehead>
       
 <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">&amp;</phrase> <phrase role="identifier">msg</phrase><phrase role="special">)</phrase>
 </programlisting>
@@ -4131,15 +4994,15 @@
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ 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.
+ role="identifier">invalid_scanns</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ nothing
           </para>
         </listitem>
         </varlistentry>
@@ -4170,15 +5033,15 @@
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ 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.
+ role="identifier">invalid_timeduration</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ nothing
           </para>
         </listitem>
         </varlistentry>
@@ -4209,15 +5072,15 @@
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ 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.
+ role="identifier">invalid_watermark</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ nothing
           </para>
         </listitem>
         </varlistentry>
@@ -4248,189 +5111,118 @@
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- Constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ 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.
+ role="identifier">task_rejected</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ 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>
+ <section id="boost_task.reference.task_unitialized">
+ <title><link linkend="boost_task.reference.task_unitialized"> Class <code><phrase
+ role="identifier">task_unitialized</phrase></code></link></title>
       <para>
         
-<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</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="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">exceptions</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
 
-<phrase role="keyword">class</phrase> <phrase role="identifier">poolsize</phrase>
+<phrase role="keyword">class</phrase> <phrase role="identifier">task_unitialized</phrase> <phrase role="special">:</phrase> <phrase role="keyword">public</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">logic_error</phrase>
 <phrase role="special">{</phrase>
 <phrase role="keyword">public</phrase><phrase role="special">:</phrase>
- <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>
-
- <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><phrase role="special">;</phrase>
+ <phrase role="identifier">task_unitialized</phrase><phrase role="special">();</phrase>
 <phrase role="special">};</phrase>
 </programlisting>
       </para>
- <anchor id="boost_task.reference.poolsize.constructor"/>
+ <anchor id="boost_task.reference.task_unitialized.constructor"/>
       <bridgehead renderas="sect4">
- <link linkend="boost_task.reference.poolsize.constructor">Constructor</link>
+ <link linkend="boost_task.reference.task_unitialized.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><phrase role="identifier">task_unitialized</phrase><phrase role="special">()</phrase>
 </programlisting>
       <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- value &gt; 0
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
+ <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">poolsize</phrase></code> instance
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Postconditions:</term>
- <listitem>
- <para>
- operator std::size_t () &gt; 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>
- </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
+ role="identifier">task_unitialized</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ nothing
           </para>
         </listitem>
         </varlistentry>
       </variablelist>
     </section>
- <section id="boost_task.reference.high_watermark">
- <title><link linkend="boost_task.reference.high_watermark"> Class <code><phrase
- role="identifier">high_watermark</phrase></code></link></title>
+ <section id="boost_task.reference.task_already_executed">
+ <title><link linkend="boost_task.reference.task_already_executed"> Class <code><phrase
+ role="identifier">task_already_executed</phrase></code></link></title>
       <para>
         
-<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">watermark</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">exceptions</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
 
-<phrase role="keyword">class</phrase> <phrase role="identifier">high_watermark</phrase>
+<phrase role="keyword">class</phrase> <phrase role="identifier">task_already_executed</phrase> <phrase role="special">:</phrase> <phrase role="keyword">public</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">logic_error</phrase>
 <phrase role="special">{</phrase>
 <phrase role="keyword">public</phrase><phrase role="special">:</phrase>
- <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>
-
- <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><phrase role="special">;</phrase>
+ <phrase role="identifier">task_already_executed</phrase><phrase role="special">();</phrase>
 <phrase role="special">};</phrase>
 </programlisting>
       </para>
- <anchor id="boost_task.reference.high_watermark.constructor"/>
+ <anchor id="boost_task.reference.task_already_executed.constructor"/>
       <bridgehead renderas="sect4">
- <link linkend="boost_task.reference.high_watermark.constructor">Constructor</link>
+ <link linkend="boost_task.reference.task_already_executed.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><phrase role="identifier">task_already_executed</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>
- <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>
- </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
+ role="identifier">task_already_executed</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ nothing
           </para>
         </listitem>
         </varlistentry>
       </variablelist>
     </section>
- <section id="boost_task.reference.low_watermark">
- <title><link linkend="boost_task.reference.low_watermark"> Class <code><phrase
- role="identifier">low_watermark</phrase></code></link></title>
+ <section id="boost_task.reference.task_moved">
+ <title><link linkend="boost_task.reference.task_moved"> Class <code><phrase
+ role="identifier">task_moved</phrase></code></link></title>
       <para>
         
-<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">watermark</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">exceptions</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
 
-<phrase role="keyword">class</phrase> <phrase role="identifier">low_watermark</phrase>
+<phrase role="keyword">class</phrase> <phrase role="identifier">task_moved</phrase> <phrase role="special">:</phrase> <phrase role="keyword">public</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">logic_error</phrase>
 <phrase role="special">{</phrase>
 <phrase role="keyword">public</phrase><phrase role="special">:</phrase>
- <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>
-
- <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><phrase role="special">;</phrase>
+ <phrase role="identifier">task_moved</phrase><phrase role="special">();</phrase>
 <phrase role="special">};</phrase>
 </programlisting>
       </para>
- <anchor id="boost_task.reference.low_watermark.constructor"/>
+ <anchor id="boost_task.reference.task_moved.constructor"/>
       <bridgehead renderas="sect4">
- <link linkend="boost_task.reference.low_watermark.constructor">Constructor</link>
+ <link linkend="boost_task.reference.task_moved.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><phrase role="identifier">task_moved</phrase><phrase role="special">()</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
@@ -4438,119 +5230,130 @@
           <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
+ role="identifier">task_moved</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>
+ nothing
           </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_"/>
+ </section>
+ <section id="boost_task.reference.broken_task">
+ <title><link linkend="boost_task.reference.broken_task"> Class <code><phrase
+ role="identifier">broken_task</phrase></code></link></title>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">exceptions</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+
+<phrase role="keyword">class</phrase> <phrase role="identifier">broken_task</phrase> <phrase role="special">:</phrase> <phrase role="keyword">public</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">logic_error</phrase>
+<phrase role="special">{</phrase>
+<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+ <phrase role="identifier">broken_task</phrase><phrase role="special">();</phrase>
+<phrase role="special">};</phrase>
+</programlisting>
+ </para>
+ <anchor id="boost_task.reference.broken_task.constructor"/>
       <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>
+ <link linkend="boost_task.reference.broken_task.constructor">Constructor</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><phrase role="identifier">broken_task</phrase><phrase role="special">()</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- returns low watermark
+ constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">broken_task</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ 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>
+ <section id="boost_task.reference.task_interrupted">
+ <title><link linkend="boost_task.reference.task_interrupted"> Class <code><phrase
+ role="identifier">task_interrupted</phrase></code></link></title>
       <para>
         
-<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">scanns</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">exceptions</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
 
-<phrase role="keyword">class</phrase> <phrase role="identifier">scanns</phrase>
+<phrase role="keyword">class</phrase> <phrase role="identifier">task_interrupted</phrase> <phrase role="special">:</phrase> <phrase role="keyword">public</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">runtime_error</phrase>
 <phrase role="special">{</phrase>
 <phrase role="keyword">public</phrase><phrase role="special">:</phrase>
- <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>
-
- <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><phrase role="special">;</phrase>
+ <phrase role="identifier">task_interrupted</phrase><phrase role="special">();</phrase>
 <phrase role="special">};</phrase>
 </programlisting>
       </para>
- <anchor id="boost_task.reference.scanns.constructor"/>
+ <anchor id="boost_task.reference.task_interrupted.constructor"/>
       <bridgehead renderas="sect4">
- <link linkend="boost_task.reference.scanns.constructor">Constructor</link>
+ <link linkend="boost_task.reference.task_interrupted.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><phrase role="identifier">task_interrupted</phrase><phrase role="special">()</phrase>
 </programlisting>
       <variablelist>
- <title></title> <varlistentry><term>Preconditions:</term>
- <listitem>
- <para>
- value &gt; 0
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Effects:</term>
+ <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">scanns</phrase></code> instance
- </para>
- </listitem>
- </varlistentry> <varlistentry><term>Postconditions:</term>
- <listitem>
- <para>
- operator std::size_t () &gt; 0
+ role="identifier">task_interrupted</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_poolsize</phrase></code>
+ nothing
           </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_"/>
+ </section>
+ <section id="boost_task.reference.pool_moved">
+ <title><link linkend="boost_task.reference.pool_moved"> Class <code><phrase
+ role="identifier">pool_moved</phrase></code></link></title>
+ <para>
+
+<programlisting><phrase role="preprocessor">#include</phrase> <phrase role="special">&lt;</phrase><phrase role="identifier">boost</phrase><phrase role="special">/</phrase><phrase role="identifier">task</phrase><phrase role="special">/</phrase><phrase role="identifier">exceptions</phrase><phrase role="special">.</phrase><phrase role="identifier">hpp</phrase><phrase role="special">&gt;</phrase>
+
+<phrase role="keyword">class</phrase> <phrase role="identifier">pool_moved</phrase> <phrase role="special">:</phrase> <phrase role="keyword">public</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">logic_error</phrase>
+<phrase role="special">{</phrase>
+<phrase role="keyword">public</phrase><phrase role="special">:</phrase>
+ <phrase role="identifier">pool_moved</phrase><phrase role="special">();</phrase>
+<phrase role="special">};</phrase>
+</programlisting>
+ </para>
+ <anchor id="boost_task.reference.pool_moved.constructor"/>
       <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>
+ <link linkend="boost_task.reference.pool_moved.constructor">Constructor</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><phrase role="identifier">pool_moved</phrase><phrase role="special">()</phrase>
 </programlisting>
       <variablelist>
         <title></title> <varlistentry><term>Effects:</term>
         <listitem>
           <para>
- returns the value
+ constructs a <code><phrase role="identifier">boost</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">task</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">pool_moved</phrase></code> instance
           </para>
         </listitem>
         </varlistentry> <varlistentry><term>Throws:</term>
         <listitem>
           <para>
- Nothing
+ nothing
           </para>
         </listitem>
         </varlistentry>
@@ -4625,21 +5428,8 @@
       <itemizedlist>
         <listitem>
           With special support of concurrence and synchronisation abstractions interdepended
- tasks work in <emphasis>thread-pools</emphasis> (using context switching/fibers).
- </listitem>
- </itemizedlist>
- <anchor id="boost_task.appendices.todo.support_of_explicit_processor_bindig"/>
- <bridgehead renderas="sect4">
- <link linkend="boost_task.appendices.todo.support_of_explicit_processor_bindig">Support
- of explicit processor bindig</link>
- </bridgehead>
- <itemizedlist>
- <listitem>
- <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
- processor binding.
+ tasks work in <emphasis>thread-pools</emphasis> without deadlocking the
+ pool.
         </listitem>
       </itemizedlist>
       <anchor id="boost_task.appendices.todo.optimizations"/>
@@ -4655,29 +5445,14 @@
           policies fifo, priority, smart?)
         </listitem>
       </itemizedlist>
- <anchor id="boost_task.appendices.todo.actor_framework"/>
- <bridgehead renderas="sect4">
- <link linkend="boost_task.appendices.todo.actor_framework">Actor framework</link>
- </bridgehead>
- <itemizedlist>
- <listitem>
- framework support of communication and synchronisation between tasks
- </listitem>
- <listitem>
- so called actors provide the required mechanisms
- </listitem>
- <listitem>
- for a detailed explanation read Micorsoft proposal of <ulink url="http://msdn.microsoft.com/en-us/devlabs/dd795202.aspx">Axum</ulink>
- </listitem>
- </itemizedlist>
     </section>
     <section id="boost_task.appendices.acknowledgements">
       <title><link linkend="boost_task.appendices.acknowledgements"> Appendix B:
       Acknowledgments</link></title>
       <para>
- 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.
+ I'd like to thank Vicente J. Botet Escriba for his comments and contributions
+ (this_task::reschedule_until, this_task::delay, this_task::yield) as well
+ Anthony Williams and Braddock Gaskill for their future libraries.
       </para>
     </section>
   </section>

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -26,17 +26,19 @@
                 if ( n < cutof) return serial_fib( n);
                 else
                 {
- // fork a sub-task calculating fibonacci(n-1)
+ // create a sub-task calculating fibonacci(n-1)
                         boost::task::task< long > t1(
                                 parallel_fib,
                                 n - 1,
                                 cutof);
- // fork a sub-task calculating fibonacci(n-2)
+ // create a sub-task calculating fibonacci(n-2)
                         boost::task< long > t2(
                                 parallel_fib,
                                 n - 2,
                                 cutof);
 
+ // fork both sub-tasks by moving the task
+ // ownership to the thread-pool
                         h1 = boost::task::async( boost::move( t1) );
                         h2 = boost::task::async( boost::move( t2) );
 
@@ -56,19 +58,21 @@
>
> pool( boost::task::poolsize( 5) );
 
- // calculate fibonacci number 10
- // for numbers < 5 do inline serial calculation
+ // compute fibonacci-number 10
+ // for numbers < 5 do inline calculation
                 boost::task::task< long > t(
                         parallel_fib,
                         10,
                         5);
 
- boost::task::handle< long > h( // handle for fibonacci calculation
+ // move task ownership to thread-pool
+ boost::task::handle< long > h(
                         boost::task::async(
                                 boost::move( t),
- pool) ); // execute in the thread-pool
+ pool) );
 
- std::cout << h.get() << std::endl;
+ // access result
+ std::cout << "fibonacci(10) == " << h.get() << std::endl;
         }
 ``
 

Added: sandbox/task/libs/task/doc/html/boost_task/appendices.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/appendices.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,138 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Appendices</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="reference.html" title="Reference">
+</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="reference.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>
+</div>
+<div class="section" title="Appendices">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.appendices"></a><a class="link" href="appendices.html" title="Appendices">Appendices</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Appendix A: Future development</span></dt>
+<dt><span class="section"><a href="appendices.html#boost_task.appendices.acknowledgements"> Appendix B:
+ Acknowledgments</a></span></dt>
+</dl></div>
+<div class="section" title="Appendix A: Future development">
+<div class="titlepage"><div><div><h3 class="title">
+<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="id687757"></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">
+<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">dynamic_pool</span></code> adds or removes <span class="emphasis"><em>worker-threads</em></span>
+ from the <span class="emphasis"><em>thread-pool</em></span> depending on the work-load (undersubscription/
+ oversubscription).
+ </li></ul></div>
+<a name="boost_task.appendices.todo.communication_and_synchronisation_abstractions"></a><h5>
+<a name="id687821"></a>
+ <a class="link" href="appendices.html#boost_task.appendices.todo.communication_and_synchronisation_abstractions">Communication
+ and synchronisation abstractions</a>
+ </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Event variable</strong></span>: A event variable is a
+ bivalued variable (up/down) on which a task can wait for an event to be
+ set or reset. The calling task will be suspended until the state of the
+ event variable is that required by the caller.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Buffer</strong></span>: A bounded/unbounded buffer is
+ shared between several tasks. The data must be placed in, and retrieved
+ from, the buffer under mutual exclusion. Condition synchronisation is required
+ because a calling task attempting to place data into the buffer. When the
+ buffer is full, the task must be suspended until there is space int the
+ buffer. Also a retrieving task must be suspended when the buffer is empty.
+ The data, once read, is destroyed.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Multicast</strong></span>: The data is sent to a specific
+ group of tasks and all tasks in the group should receive the data. Only
+ when all tasks have received one item of data then another item is allowed
+ to be transmitted.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Rendezvous</strong></span>: A rendezvous uses direct naming
+ and synchronous communication between tasks. One task that executes its
+ command first will be delayed until the other tasks is ready to rendezvous.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Protected resource</strong></span>: A protected resource
+ is a passive entity that controls access to the internal states (to the
+ controled real resources).
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Task groups</strong></span>: A task group defines a graph
+ of interdependent tasks that can mostly be run in parallel. The tasks in
+ the group have dependencies or communicate with each other.
+ </li>
+</ul></div>
+<a name="boost_task.appendices.todo.interdepended_task"></a><h5>
+<a name="id687912"></a>
+ <a class="link" href="appendices.html#boost_task.appendices.todo.interdepended_task">Interdepended
+ task</a>
+ </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ With special support of concurrence and synchronisation abstractions interdepended
+ tasks work in <span class="emphasis"><em>thread-pools</em></span> without deadlocking the
+ pool.
+ </li></ul></div>
+<a name="boost_task.appendices.todo.optimizations"></a><h5>
+<a name="id687943"></a>
+ <a class="link" href="appendices.html#boost_task.appendices.todo.optimizations">Optimizations</a>
+ </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ two-lock-queue as global queue in <span class="emphasis"><em>thread-pool</em></span>
+</li>
+<li class="listitem">
+ maybe lock-free-queue as global queue too (how to provide the scheduling
+ policies fifo, priority, smart?)
+ </li>
+</ul></div>
+</div>
+<div class="section" title="Appendix B: Acknowledgments">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.appendices.acknowledgements"></a><a class="link" href="appendices.html#boost_task.appendices.acknowledgements" title="Appendix B: Acknowledgments"> Appendix B:
+ Acknowledgments</a>
+</h3></div></div></div>
+<p>
+ I'd like to thank Vicente J. Botet Escriba for his comments and contributions
+ (this_task::reschedule_until, this_task::delay, this_task::yield) as well
+ Anthony Williams and Braddock Gaskill for their future libraries.
+ </p>
+</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>
+ 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="reference.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>
+</div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/boost_task/as_sub_task.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/as_sub_task.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,64 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Execute as sub-task</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="pool.html" title="Thread-pool">
+<link rel="next" href="utilities.html" title="Utilities">
+</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="pool.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="utilities.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Execute as sub-task">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.as_sub_task"></a><a class="link" href="as_sub_task.html" title="Execute as sub-task"> Execute as sub-task</a>
+</h2></div></div></div>
+<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">as_sub_task</span></code>
+ is a convenient way to execute a <span class="emphasis"><em>sub-task</em></span>. If the parent
+ 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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</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="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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>
+</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="pool.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="utilities.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,91 @@
+<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.1">
+<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>
+ 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> applies the moved <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">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="keyword">operator</span><span class="special">()(</span>
+ <span class="identifier">task</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;</span> <span class="identifier">t</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">&lt;=</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="comment">// task computing fibonacci(10)
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</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="comment">// move the task to executor
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="comment">// access the result
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+<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>

Added: sandbox/task/libs/task/doc/html/boost_task/handle.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/handle.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,325 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Handle</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="async.html" title="Asynchronous execution">
+</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="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">
+<a name="boost_task.handle"></a><a class="link" href="handle.html" title="Handle"> Handle</a>
+</h2></div></div></div>
+<p>
+ The <span class="emphasis"><em>asynchronous-completion-token</em></span> dispatches tasks in
+ 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="id646812" href="#ftn.id646812" 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 <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="id646919"></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 to transfer
+ the result.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">is_ready</span><span class="special">()</span></code>:
+ test if result is set
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">has_value</span><span class="special">()</span></code>:
+ test if value-result is set
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">has_exception</span><span class="special">()</span></code>:
+ test if exception-result is set
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code>:
+ 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>:
+ wait until result is set
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">wait_for</span><span class="special">()</span></code>:
+ wait until result is set or time-duration has elapsed
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">wait_until</span><span class="special">()</span></code>:
+ wait until result ist set or time-point has elapsed
+ </li>
+</ul></div>
+<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">&lt;=</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="comment">// create task
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</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="comment">// move task ownership to executor
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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">&lt;&lt;</span> <span class="string">"is ready == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span><span class="special">;</span>
+
+ <span class="comment">// wait for task completion
+</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">wait</span><span class="special">();</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"has value == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">has_value</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"has exception == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">has_exception</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span><span class="special">;</span>
+
+ <span class="comment">// return result
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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.handle.task_interruption"></a><h4>
+<a name="id647994"></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="id648167" href="#ftn.id648167" 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>:
+ interrupt <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> and return immediately
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">interrupt_and_wait</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>
+</li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">interrupt_and_wait_for</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 duration has
+ elapsed
+ </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 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>:
+ return bool if interruption was requested
+ </li>
+</ul></div>
+<p>
+
+</p>
+<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 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">&lt;=</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>
+
+<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</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="comment">// move task to async. executor
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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">// interrupt task and wait until task is removed by worker-thread
+</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">&lt;&lt;</span> <span class="string">"is ready == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"has value == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">has_value</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"has exception == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">has_exception</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span><span class="special">;</span>
+
+ <span class="comment">// access result
+</span> <span class="comment">// throws boost::task::task_interrupted
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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="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 (not executed yet) 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="id649489"></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">&lt;</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="special">&gt;</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">&lt;</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="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span> <span class="identifier">fibonacci</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">move</span><span class="special">(</span> <span class="identifier">t</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">&lt;</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="special">&gt;::</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">&lt;</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="special">&gt;::</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">&lt;&lt;</span> <span class="string">"fibonacci("</span> <span class="special">&lt;&lt;</span> <span class="identifier">k</span><span class="special">++</span> <span class="special">&lt;&lt;</span> <span class="string">") == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">i</span><span class="special">-&gt;</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t1</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="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t2</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="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t3</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="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t1</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t2</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t3</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">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"fibonacci(7) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"fibonacci(5) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h3</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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.id646812" href="#id646812" 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.id648167" href="#id648167" 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>
+<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="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>

Added: sandbox/task/libs/task/doc/html/boost_task/meta_functions.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/meta_functions.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,69 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Meta functions</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="utilities.html" title="Utilities">
+<link rel="next" href="reference.html" title="Reference">
+</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="utilities.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="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Meta functions">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.meta_functions"></a><a class="link" href="meta_functions.html" title="Meta functions"> Meta functions</a>
+</h2></div></div></div>
+<p>
+ If the <span class="emphasis"><em>thread-pool</em></span> supports attributes (like priorities)
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">has_attribute</span></code>
+ evaluates to <code class="computeroutput"><span class="keyword">true</span></code> at compile-time
+ (derived from boost::mpl::bool_). The type of the attribute is determined 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">attribute_type</span></code>.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="comment">// thread-pool with priority scheduling
+</span><span class="comment">// type of priority is int
+</span><span class="identifier">typdef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">priority</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span>
+ <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool_type</span><span class="special">;</span>
+
+<span class="comment">// test if thread-pool supports priorities at compile time
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">has_attribute</span><span class="special">&lt;</span> <span class="identifier">pool_type</span> <span class="special">&gt;::</span><span class="identifier">value</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span><span class="special">;</span>
+
+<span class="comment">// access the type used for priority
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="keyword">typeid</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">attribute_type</span><span class="special">&lt;</span> <span class="identifier">pool_type</span> <span class="special">&gt;::</span><span class="identifier">type</span><span class="special">).</span><span class="identifier">name</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</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="utilities.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="reference.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/boost_task/motivation.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/motivation.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,264 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Motivation</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="../index.html" title="Chapter 1. Boost.Task">
+<link rel="next" href="task.html" title="Task">
+</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="../index.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="task.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Motivation">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.motivation"></a><a class="link" href="motivation.html" title="Motivation"> Motivation</a>
+</h2></div></div></div>
+<p>
+ 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 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>
+<p>
+ The evolution from one-core to many-core architectures and the usage of threads
+ (of course processes fit too) support this paradigm.
+ </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>
+ <span class="quote">&#8220;<span class="quote">You can have multithreading on a single core machine, but you can
+ only have parallelism on a multi core machine ... .</span>&#8221;</span> -- Daniel Moth
+ <sup>[<a name="id640350" href="#ftn.id640350" 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>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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">print</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">&amp;</span> <span class="identifier">msg</span><span class="special">)</span>
+<span class="special">{</span> <span class="identifier">printf</span><span class="special">(</span><span class="string">"%s\n"</span><span class="special">,</span> <span class="identifier">msg</span><span class="special">.</span><span class="identifier">c_str</span><span class="special">()</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="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">task</span><span class="special">&lt;</span> <span class="keyword">void</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span> <span class="identifier">print</span><span class="special">,</span> <span class="string">"Hello World!"</span><span class="special">);</span>
+
+ <span class="comment">// execute task in newly-created thread
+</span> <span class="comment">// move task ownership to executor
+</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">move</span><span class="special">(</span> <span class="identifier">t</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="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ In order to manage the task <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
+ 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>
+ (associated with the submitted task). It functions as a <span class="emphasis"><em>asynchronous-completion-token</em></span>
+ - that means it transfers the result of the execution back to the caller thread.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">echo</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">&amp;</span> <span class="identifier">msg</span><span class="special">)</span>
+<span class="special">{</span> <span class="keyword">return</span> <span class="identifier">msg</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="comment">// task returning the submitted string
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</span> <span class="identifier">t</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="comment">// execute task in newly-created thread
+</span> <span class="comment">// move task ownership to executor
+</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">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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">// wait until task has finished and return the result
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+ The task can also be interrupted via <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> if it is a so-called <a class="link" href="task.html" title="Task"><span class="emphasis"><em>cooperative
+ task</em></span></a>.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">void</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">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</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">sleep</span><span class="special">(</span> <span class="identifier">rel_time</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="comment">// create a long runing task
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">void</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</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="comment">// execute task in newly-created thread
+</span> <span class="comment">// move task ownership to executor
+</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">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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">// requests interruption of task
+</span> <span class="comment">// returns immediately
+</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">interrupt</span><span class="special">();</span>
+
+ <span class="comment">// access the result
+</span> <span class="comment">// task_interrupted exeception will be thrown
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+ Beside <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>
+ (which creates a new task for each submitted task - the thread will be joined
+ 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">handle</span></code>)
+ <span class="bold"><strong>Boost.Task</strong></span> provides <a class="link" href="pool.html" title="Thread-pool"><span class="emphasis"><em>thread-pools</em></span></a>
+ to prevent the overhead of thread creation and destruction of threads for each
+ task (<span class="emphasis"><em>thread-pools</em></span> can be customized).
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">serial_fib</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">&lt;</span> <span class="number">2</span><span class="special">)</span> <span class="keyword">return</span> <span class="identifier">n</span><span class="special">;</span>
+ <span class="keyword">else</span> <span class="keyword">return</span> <span class="identifier">serial_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="special">+</span> <span class="identifier">serial_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="special">}</span>
+
+<span class="keyword">long</span> <span class="identifier">parallel_fib</span><span class="special">(</span> <span class="keyword">long</span> <span class="identifier">n</span><span class="special">,</span> <span class="keyword">long</span> <span class="identifier">cutof</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">&lt;</span> <span class="identifier">cutof</span><span class="special">)</span> <span class="keyword">return</span> <span class="identifier">serial_fib</span><span class="special">(</span> <span class="identifier">n</span><span class="special">);</span>
+ <span class="keyword">else</span>
+ <span class="special">{</span>
+ <span class="comment">// create a sub-task calculating fibonacci(n-1)
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t1</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="comment">// create a sub-task calculating fibonacci(n-2)
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t2</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="comment">// fork two sub-tasks
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t1</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="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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t2</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="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>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="comment">// create a thread-pool with five worker-threads
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">fifo</span>
+ <span class="special">&gt;</span>
+ <span class="special">&gt;</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="comment">// create task computing fibonacci-number for 10
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+ <span class="identifier">parallel_fib</span><span class="special">,</span>
+ <span class="number">10</span><span class="special">,</span>
+ <span class="number">5</span><span class="special">);</span>
+
+ <span class="comment">// execute task in a thread-pool
+</span> <span class="comment">// move task ownership to executor
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</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="special">);</span>
+
+ <span class="comment">// access the result
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+ With function <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">runs_in_pool</span><span class="special">()</span></code>
+ a task can detect if it is executed inside a <span class="emphasis"><em>thread-pool</em></span>.
+ <span class="emphasis"><em>sub-tasks</em></span> arecreated 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">as_sub_task</span></code>. Where the <span class="emphasis"><em>sub-task</em></span>
+ is executed by a new thread if the parent task is not executed inside a <span class="emphasis"><em>thread-pool</em></span>.
+ In the other case the <span class="emphasis"><em>sub-task</em></span> is put into the local
+ <span class="emphasis"><em>worker-queue</em></span> which enables <a class="link" href="pool.html#boost_task.pool.work_stealing" title="Work-Stealing"><span class="emphasis"><em>work-stealing</em></span></a>
+ and <a class="link" href="pool.html#boost_task.pool.forkjoin" title="Fork/Join">inline execution</a> of tasks.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="comment">// create a long runing task
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+ <span class="identifier">parallel_fib</span><span class="special">,</span>
+ <span class="number">10</span><span class="special">,</span>
+ <span class="number">5</span><span class="special">);</span>
+
+<span class="comment">// move task ownership to executor
+</span><span class="comment">// sub-task executed in a new thread or inside the 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">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span> <span class="identifier">t</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>
+</pre>
+<p>
+ </p>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a name="ftn.id640350" href="#id640350" class="para">1</a>] </sup>
+ more to read at Daniel's blog
+ </p></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>
+ 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="../index.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="task.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/boost_task/new_thread.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/new_thread.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,115 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Execute in new thread</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="own_thread.html" title="Execute in own thread">
+<link rel="next" href="pool.html" title="Thread-pool">
+</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="own_thread.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="pool.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Execute in new thread">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.new_thread"></a><a class="link" href="new_thread.html" title="Execute in new thread"> Execute in new thread</a>
+</h2></div></div></div>
+<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">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). 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) .
+ </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">&lt;=</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</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="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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 because 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>
+ is not stored in a variable. Thatswhy the <span class="emphasis"><em>worker-thread</em></span>
+ is joined after return from <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">task</span><span class="special">&lt;</span> <span class="keyword">void</span> <span class="special">&gt;</span> <span class="identifier">t1</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">task</span><span class="special">&lt;</span> <span class="keyword">void</span> <span class="special">&gt;</span> <span class="identifier">t2</span><span class="special">(</span> <span class="identifier">another_function</span><span class="special">);</span>
+
+<span class="comment">// handles are not retrieved
+</span><span class="comment">// both task executed in sequence
+</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">move</span><span class="special">(</span> <span class="identifier">t1</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">move</span><span class="special">(</span> <span class="identifier">t2</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>
+</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="own_thread.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="pool.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/boost_task/own_thread.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/own_thread.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,80 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Execute in own thread</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="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">
+<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="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">
+<a name="boost_task.own_thread"></a><a class="link" href="own_thread.html" title="Execute in own thread"> Execute in own thread</a>
+</h2></div></div></div>
+<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">own_thread</span></code>
+ executes the task in the current thread (synchronous execution - concerns of
+ N2802
+ do not aply).
+ </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">&lt;=</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</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="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">handle</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+<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="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>

Added: sandbox/task/libs/task/doc/html/boost_task/pool.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/pool.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,707 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Thread-pool</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="new_thread.html" title="Execute in new thread">
+<link rel="next" href="as_sub_task.html" title="Execute as sub-task">
+</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="new_thread.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="as_sub_task.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Thread-pool">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.pool"></a><a class="link" href="pool.html" title="Thread-pool"> Thread-pool</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Static thread-pool</span></dt>
+<dt><span class="section"> Channel</span></dt>
+<dt><span class="section"> Scheduling</span></dt>
+<dt><span class="section"> Pool shutdown</span></dt>
+<dt><span class="section"> Processor binding</span></dt>
+<dt><span class="section"> Work-Stealing</span></dt>
+<dt><span class="section"> Fork/Join</span></dt>
+</dl></div>
+<p>
+ Instead of creating a new thread and quickly throwing it away after the task
+ is done, the overhead related to thread creation and destruction can be avoided
+ by running the <span class="emphasis"><em>work-items</em></span> on a <span class="emphasis"><em>thread-pool</em></span>
+ (reusing an existing <span class="emphasis"><em>worker-thread</em></span> instead).
+ </p>
+<p>
+ A <span class="emphasis"><em>thread-pool</em></span> maintains a queue (or queues) of <span class="emphasis"><em>work-items</em></span>
+ to be done, and a pool of <span class="emphasis"><em>worker-threads</em></span> which execute
+ <span class="emphasis"><em>work-items</em></span> from the queue(s).
+ </p>
+<p>
+ <span class="bold"><strong>Boost.Task</strong></span> provides <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> with
+ support of executing 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> in <span class="emphasis"><em>thread-pool</em></span>:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">echo</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">&amp;</span> <span class="identifier">msg</span><span class="special">)</span>
+<span class="special">{</span> <span class="keyword">return</span> <span class="identifier">msg</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="comment">// create a thread-pool with
+</span> <span class="comment">// five worker-threads
+</span> <span class="comment">// FIFO schduling of queued tasks
+</span> <span class="comment">// and unlimited size of internal queue
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">fifo</span>
+ <span class="special">&gt;</span>
+ <span class="special">&gt;</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="comment">// create task
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</span> <span class="identifier">t</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="comment">// move task to executor
+</span> <span class="comment">// let the task be executed by the thread-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">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&gt;</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">move</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="special">);</span>
+
+ <span class="comment">// access the result
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../doc/html/images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ Tasks should not be too small (performance overhead dominates) and avoid
+ blocking tasks
+ <sup>[<a name="id655144" href="#ftn.id655144" class="footnote">5</a>]</sup>
+ .
+ </p></td></tr>
+</table></div>
+<div class="section" title="Static thread-pool">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.pool.static_pool"></a><a class="link" href="pool.html#boost_task.pool.static_pool" title="Static thread-pool"> Static thread-pool</a>
+</h3></div></div></div>
+<p>
+ <span class="bold"><strong>Boost.Task</strong></span> provides <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span></code>
+ - which contains an fixed set of pre-forked <span class="emphasis"><em>worker-threads</em></span>
+ (the size of the pool doesn't change during its lifetime). <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span></code> supports move semantics.
+ </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">_static_pool</span><span class="special">&lt;</span> <span class="comment">// pool type
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="comment">// queuing policy (unbounded_channel, bounded_channel)
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">fifo</span> <span class="comment">// scheduling policy (fifo, priority, smart)
+</span> <span class="special">&gt;</span>
+<span class="special">&gt;</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">6</span><span class="special">),</span> <span class="comment">// pool with 6 pre-forked worker-threads
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">50</span><span class="special">),</span> <span class="comment">// time to sleep if no work-item available
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">scanns</span><span class="special">(</span> <span class="number">10</span><span class="special">)</span> <span class="special">);</span> <span class="comment">// iterations over local-queues before sleep
+</span></pre>
+<p>
+ </p>
+<p>
+ The first argument of the constructor specifies how many <span class="emphasis"><em>worker-threads</em></span>
+ the pool will contain. The second and third argument are used by the <a class="link" href="pool.html#boost_task.pool.work_stealing" title="Work-Stealing"><span class="emphasis"><em>work-stealing</em></span></a>
+ algorithm.
+ </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 <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> is used as queuing policy
+ the constructor has two additional arguments .
+ </p></td></tr>
+</table></div>
+<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">static_pool</span></code> provides functionality to check
+ the status of the pool - <code class="computeroutput"><span class="identifier">close</span><span class="special">()</span></code> returns true when the pool was shutdown
+ and <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code>
+ as well as <code class="computeroutput"><span class="identifier">idle</span><span class="special">()</span></code>
+ returning how many <span class="emphasis"><em>worker-threads</em></span> are active (executing
+ a task) or idle. The size of the pool can be accessed over <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code>.
+ </p>
+<p>
+ For informational pruposes <code class="computeroutput"><span class="identifier">empty</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">pending</span><span class="special">()</span></code> can be used in order to know if the global
+ task-queue is empty or how many tasks are waiting for execution. With <code class="computeroutput"><span class="identifier">clear</span><span class="special">()</span></code>
+ all tasks are removed from the global-queue.
+ </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>
+ <code class="computeroutput"><span class="identifier">pending</span><span class="special">()</span></code>
+ does not count tasks in the local-queues of the <span class="emphasis"><em>worker-threads</em></span>.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" title="Channel">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.pool.channel"></a><a class="link" href="pool.html#boost_task.pool.channel" title="Channel"> Channel</a>
+</h3></div></div></div>
+<p>
+ The channel synchronizes the access between non-pool threads (application
+ threads) and <span class="emphasis"><em>worker-threads</em></span> and implements a queuing
+ 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="id655776"></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>
+ <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> contains a single lock
+ in order to synchronize access to the queue. The number of pending tasks
+ is limited in order to prevent resource exhaustion. For this purpose a high-
+ and low-watermark has to be passed at construction. <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">high_watermark</span></code>
+ sets the maximum of pending tasks. If this limited is reached all threads
+ which submit a task will be set to sleep (blocked). If it is equal 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">low_watermark</span></code> everytime a sleeping producer
+ thread will be woken up and puts its task if one worker thread has taken
+ a task from the channel. <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>
+ sets the threshold when blocked threads get woken up. If it is less than
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">high_watermark</span></code> all sleeping producer threads
+ 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="id656008"></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>
+ <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> contains a single lock
+ in order to synchronize access to the queue. An unlimited number of tasks
+ can be queued into this channel. The insertion of 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>
+ will never block. If the channel becomes empty <span class="emphasis"><em>worker-threads</em></span>
+ will be set to sleep until new tasks are enqueued.
+ </p>
+</div>
+<div class="section" title="Scheduling">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.pool.scheduling"></a><a class="link" href="pool.html#boost_task.pool.scheduling" title="Scheduling"> Scheduling</a>
+</h3></div></div></div>
+<p>
+ 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="id656149"></a>
+ <a class="link" href="pool.html#boost_task.pool.scheduling.fifo">fifo</a>
+ </h5>
+<p>
+ First inserted pending <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>
+ gets taken first.
+ </p>
+<a name="boost_task.pool.scheduling.priority"></a><h5>
+<a name="id656201"></a>
+ <a class="link" href="pool.html#boost_task.pool.scheduling.priority">priority</a>
+ </h5>
+<p>
+ 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> is submitted to the pool with a priority
+ attribute. The type and ordering of the priority is user-defined.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="comment">// thread-pool with priority scheduling
+</span><span class="comment">// tasks with higher priority are
+</span><span class="comment">// scheduled first
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">priority</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="special">&gt;</span>
+<span class="special">&gt;</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">task</span><span class="special">&lt;</span> <span class="keyword">void</span> <span class="special">&gt;</span> <span class="identifier">t1</span><span class="special">(</span> <span class="identifier">some_fn</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">task</span><span class="special">&lt;</span> <span class="keyword">void</span> <span class="special">&gt;</span> <span class="identifier">t2</span><span class="special">(</span> <span class="identifier">another_fn</span><span class="special">);</span>
+
+<span class="comment">// move task t1 with priority 5 to 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">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span> <span class="identifier">t1</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="comment">// move task t2 with priority 3 to 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">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span> <span class="identifier">t2</span><span class="special">),</span>
+ <span class="number">3</span><span class="special">,</span>
+ <span class="identifier">pool</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ In this example the tasks get scheduled by the assigned integer (third argument
+ 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>).
+ 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> with the lowest priority gets scheduled
+ first (taken by a <span class="emphasis"><em>worker-thread</em></span>). The ordering can be
+ changed by the second argument 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">priority</span></code>
+ (the default is <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">greater</span><span class="special">&lt;</span> <span class="identifier">Attr</span> <span class="special">&gt;</span></code>).
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="comment">// thread-pool with priority scheduling
+</span><span class="comment">// tasks with lower priority are
+</span><span class="comment">// scheduled first
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">priority</span><span class="special">&lt;</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">less</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="special">&gt;</span>
+ <span class="special">&gt;</span>
+<span class="special">&gt;</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>
+</pre>
+<p>
+ </p>
+<a name="boost_task.pool.scheduling.smart"></a><h5>
+<a name="id657077"></a>
+ <a class="link" href="pool.html#boost_task.pool.scheduling.smart">smart</a>
+ </h5>
+<p>
+ Each inserted <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> is associated with an attribute. The
+ scheduler gets an put- and take-policy as template arguments. The corresponding
+ policy gets applied for each insertion and removal.
+ </p>
+<p>
+ <span class="bold"><strong>Boost.Task</strong></span> provides <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">replace_oldest</span></code>
+ as put- policy 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">take_oldest</span></code>
+ as take-policy. Both policies allow the replacement of older (pending) tasks
+ in the scheduler by new ones.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">fibonacci_fn</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">&lt;=</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">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">smart</span><span class="special">&lt;</span>
+ <span class="keyword">int</span><span class="special">,</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">less</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">replace_oldest</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">take_oldest</span>
+ <span class="special">&gt;</span>
+ <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool_type</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">pool_type</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">1</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t1</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</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="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t2</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</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="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">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span> <span class="identifier">t1</span><span class="special">),</span>
+ <span class="number">2</span><span class="special">,</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">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span> <span class="identifier">t2</span><span class="special">),</span>
+ <span class="number">2</span><span class="special">,</span>
+ <span class="identifier">pool</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+<div class="section" title="Pool shutdown">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.pool.pool_shutdown"></a><a class="link" href="pool.html#boost_task.pool.pool_shutdown" title="Pool shutdown"> Pool shutdown</a>
+</h3></div></div></div>
+<p>
+ <span class="bold"><strong>Boost.Task</strong></span> allows to shutdown a <span class="emphasis"><em>thread-pool</em></span>
+ explicitly via functions <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">shutdown_now</span><span class="special">()</span></code>. The destructor of the pool calls <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code>
+ if not already done so that all <span class="emphasis"><em>worker-threads</em></span> are joined
+ and the topic of N2802
+ should be addressed.
+ </p>
+<a name="boost_task.pool.pool_shutdown.shutdown"></a><h5>
+<a name="id658313"></a>
+ <a class="link" href="pool.html#boost_task.pool.pool_shutdown.shutdown">Shutdown</a>
+ </h5>
+<p>
+ If <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code>
+ is called - the the pool is set the closed state and all <span class="emphasis"><em>worker-threads</em></span>
+ are joined until all pending tasks are processed. No futher tasks can be
+ submitted.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">fibonacci_fn</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">&lt;=</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">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">fifo</span>
+ <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool_type</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">pool_type</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">1</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t1</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t2</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">handle</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t1</span><span class="special">),</span>
+ <span class="identifier">pool</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t2</span><span class="special">),</span>
+ <span class="identifier">pool</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="comment">// waits until all pending tasks are finished
+</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">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"fibonacci(5) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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="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="id659496"></a>
+ <a class="link" href="pool.html#boost_task.pool.pool_shutdown.shutdown_immediatly">Shutdown
+ immediatly</a>
+ </h5>
+<p>
+ The function <code class="computeroutput"><span class="identifier">shutdown_now</span><span class="special">()</span></code> closes the pool, interrupts and then joins
+ all <span class="emphasis"><em>worker-threads</em></span>. Pending tasks are unprocessed.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">fibonacci_fn</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">&lt;=</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">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">fifo</span>
+ <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool_type</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">pool_type</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">1</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t1</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">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t2</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">handle</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t1</span><span class="special">),</span>
+ <span class="identifier">pool</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t2</span><span class="special">),</span>
+ <span class="identifier">pool</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="comment">// requests task interruption and
+</span> <span class="comment">// joins all worker-threads
+</span> <span class="identifier">pool</span><span class="special">.</span><span class="identifier">shutdown_now</span><span class="special">();</span>
+
+ <span class="comment">// accessing the result may throw task_interrupted
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"fibonacci(5) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+<div class="section" title="Processor binding">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.pool.processor_binding"></a><a class="link" href="pool.html#boost_task.pool.processor_binding" title="Processor binding"> Processor binding</a>
+</h3></div></div></div>
+<p>
+ For some applications it is convenient to bind the <span class="emphasis"><em>worker-threads</em></span>
+ to processors/cores of the system. For this purpose <code class="computeroutput"><span class="identifier">bind_to_processors</span><span class="special">()</span></code> must be given to constructor instead <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> so that a <span class="emphasis"><em>worker-thread</em></span>
+ is created an bound the the core.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool_type</span><span class="special">;</span>
+
+<span class="comment">// constructs thread-pool with worker-threads as
+</span><span class="comment">// CPUs/Cores are available on the system
+</span><span class="identifier">pool_type</span> <span class="identifier">pool</span><span class="special">(</span> <span class="identifier">pool_type</span><span class="special">::</span><span class="identifier">bind_to_processors</span><span class="special">()</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ The constructor takes additional arguments for the <a class="link" href="pool.html#boost_task.pool.work_stealing" title="Work-Stealing">work-stealing
+ algorithm</a> and <a class="link" href="pool.html#boost_task.pool.channel" title="Channel">high-</a>
+ and <a class="link" href="pool.html#boost_task.pool.channel" title="Channel">low-watermark</a> too.
+ </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>
+ <span class="bold"><strong>Boost.Task</strong></span> does provide this feature only
+ for Windows, Linux, AIX, HP-UX, Solaris and FreeBSD.
+ </p></td></tr>
+</table></div>
+</div>
+<div class="section" title="Work-Stealing">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.pool.work_stealing"></a><a class="link" href="pool.html#boost_task.pool.work_stealing" title="Work-Stealing"> Work-Stealing</a>
+</h3></div></div></div>
+<p>
+ Traditional <span class="emphasis"><em>thread-pools</em></span> do not scale because they use
+ a single global-queue protected by a global-lock. The frequency at which
+ <span class="emphasis"><em>worker-threads</em></span> aquire the global-lock becomes a limiting
+ factor for the throughput if:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ the tasks become smaller
+ </li>
+<li class="listitem">
+ more processors are added
+ </li>
+</ul></div>
+<p>
+ A <span class="emphasis"><em>work-stealing</em></span> algorithm can be used to solve this
+ problem. It uses a special kind of queue which has two ends, and allows lock-free
+ pushes and pops from the <span class="emphasis"><em>private end</em></span> (accessed by the
+ <span class="emphasis"><em>worker-thread</em></span> owning the queue), but requires synchronization
+ from the <span class="emphasis"><em>public end</em></span> (accessed by the other <span class="emphasis"><em>worker-threads</em></span>).
+ Synchronization is necessary when the queue is sufficiently small that private
+ and public operations could conflict.
+ </p>
+<p>
+ The pool contains one global-queue (<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>
+ or <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>) protected by a global-lock
+ and each <span class="emphasis"><em>worker-thread</em></span> has its own private local worker-queue.
+ If work is enqueued by a <span class="emphasis"><em>worker-thread</em></span> 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> is stored in the worker queue. If
+ the work is enqueued by a application thread it goes into the global queue.
+ When <span class="emphasis"><em>worker-threads</em></span> are looking for work, they have
+ following search order:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ look into the private worker-queue - tasks can be dequeued without locks
+ </li>
+<li class="listitem">
+ look in the global-queue - locks are used for synchronization
+ </li>
+<li class="listitem">
+ check other worker-queues ('stealing' tasks from private worker queues
+ of other <span class="emphasis"><em>worker-threads</em></span>) - requires locks
+ </li>
+</ul></div>
+<p>
+ For a lot of recursively queued tasks (so called <span class="emphasis"><em>sub-tasks</em></span>),
+ the use of a worker-queue per thread substantially reduces the synchronization
+ necessary to complete the work. There are also fewer cache effects due to
+ sharing of the global-queue information.
+ </p>
+<p>
+ Operations on the private worker queue are executed in LIFO order and operations
+ on worker queues of other <span class="emphasis"><em>worker-threads</em></span> in FIFO order
+ (steals).
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ There are chances that memory is still hot in the cache, if the tasks are
+ pushed in LIFO order into the private worker queue.
+ </li>
+<li class="listitem">
+ If a <span class="emphasis"><em>worker-thread</em></span> steals work in FIFO order, increases
+ the chances that a larger 'chunk' of work will be stolen (the need for
+ other steals will be possibly reduced). Because the <span class="emphasis"><em>sub-tasks</em></span>
+ are stored in LIFO order, the oldest items are closer to the <span class="emphasis"><em>public
+ end</em></span> of the queue (forming a tree). Stealing such an older <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> also steals a (probably) larger
+ subtree of tasks unfolded if the stolen work item get executed. Since a
+ <span class="emphasis"><em>sub-task</em></span> is just part of a larger <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>,
+ we don&#8217;t need to worry about execution order.
+ </li>
+</ul></div>
+</div>
+<p>
+ / 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
+ ]
+ </p>
+<div class="section" title="Fork/Join">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.pool.forkjoin"></a><a class="link" href="pool.html#boost_task.pool.forkjoin" title="Fork/Join"> Fork/Join</a>
+</h3></div></div></div>
+<p>
+ Fork/Join algorithms are recursive divide-and-conquer algorithms which repeatedly
+ splitt into sub-tasks until they become small enough to solve using simple,
+ short sequential methods, so that they run in parallel on multiple cores.
+ </p>
+<p>
+ The fork operation creates new <span class="emphasis"><em>sub-tasks</em></span> which can run
+ in parallel. 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>
+ is not proceeded in the join operation until the forked <span class="emphasis"><em>sub-tasks</em></span>
+ have completed. In the meantime the <span class="emphasis"><em>worker-thread</em></span> executes
+ other tasks from its local <span class="emphasis"><em>worker-queue</em></span>.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">serial_fib</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">&lt;</span> <span class="number">2</span><span class="special">)</span> <span class="keyword">return</span> <span class="identifier">n</span><span class="special">;</span>
+ <span class="keyword">else</span> <span class="keyword">return</span> <span class="identifier">serial_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="special">+</span> <span class="identifier">serial_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="special">}</span>
+
+<span class="keyword">long</span> <span class="identifier">parallel_fib</span><span class="special">(</span> <span class="keyword">long</span> <span class="identifier">n</span><span class="special">,</span> <span class="keyword">long</span> <span class="identifier">cutof</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">&lt;</span> <span class="identifier">cutof</span><span class="special">)</span> <span class="keyword">return</span> <span class="identifier">serial_fib</span><span class="special">(</span> <span class="identifier">n</span><span class="special">);</span>
+ <span class="keyword">else</span>
+ <span class="special">{</span>
+ <span class="comment">// create a sub-task calculating fibonacci(n-1)
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t1</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="comment">// create a sub-task calculating fibonacci(n-2)
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t2</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="comment">// fork both sub-tasks by moving the task
+</span> <span class="comment">// ownership to the thread-pool
+</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">move</span><span class="special">(</span> <span class="identifier">t1</span><span class="special">)</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">move</span><span class="special">(</span> <span class="identifier">t2</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
+</span> <span class="comment">// task from its local-queue
+</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>
+<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">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">fifo</span>
+ <span class="special">&gt;</span>
+ <span class="special">&gt;</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="comment">// compute fibonacci-number 10
+</span> <span class="comment">// for numbers &lt; 5 do inline calculation
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+ <span class="identifier">parallel_fib</span><span class="special">,</span>
+ <span class="number">10</span><span class="special">,</span>
+ <span class="number">5</span><span class="special">);</span>
+
+ <span class="comment">// move task ownership to thread-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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</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="special">);</span>
+
+ <span class="comment">// access result
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+<div class="footnotes">
+<br><hr width="100" align="left">
+<div class="footnote"><p><sup>[<a name="ftn.id655144" href="#id655144" 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>
+</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>
+ 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="new_thread.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="as_sub_task.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/boost_task/reference.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/reference.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,2752 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Reference</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="meta_functions.html" title="Meta functions">
+<link rel="next" href="appendices.html" title="Appendices">
+</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="meta_functions.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="appendices.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Reference">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.reference"></a><a class="link" href="reference.html" title="Reference"> Reference</a>
+</h2></div></div></div>
+<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"><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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</span> <span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;</span> <span class="special">&amp;)</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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</span> <span class="identifier">Attr</span><span class="special">,</span> <span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">Channel</span> <span class="special">&gt;</span>
+ <span class="special">&amp;)</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"><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>
+<dt><span class="section"> Class poolsize</span></dt>
+<dt><span class="section"> Class high_watermark</span></dt>
+<dt><span class="section"> Class low_watermark</span></dt>
+<dt><span class="section"> Class scanns</span></dt>
+<dt><span class="section"> Class invalid_poolsize</span></dt>
+<dt><span class="section"> Class invalid_scanns</span></dt>
+<dt><span class="section"> Class invalid_timeduration</span></dt>
+<dt><span class="section"> Class invalid_watermark</span></dt>
+<dt><span class="section"> Class task_rejected</span></dt>
+<dt><span class="section"> Class task_unitialized</span></dt>
+<dt><span class="section"> Class task_already_executed</span></dt>
+<dt><span class="section"> Class task_moved</span></dt>
+<dt><span class="section"> Class broken_task</span></dt>
+<dt><span class="section"> Class task_interrupted</span></dt>
+<dt><span class="section"> Class pool_moved</span></dt>
+</dl></div>
+<div class="section" title="Class template task">
+<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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">task</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">task</span> <span class="special">:</span> <span class="keyword">private</span> <span class="identifier">noncopyable</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">task</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">fn</span><span class="special">)());</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Fn</span> <span class="special">&gt;</span>
+ <span class="identifier">task</span><span class="special">(</span> <span class="identifier">Fn</span> <span class="identifier">fn</span><span class="special">);</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+ <span class="identifier">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">&lt;</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">A9</span> <span class="special">&gt;</span>
+ <span class="identifier">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">A9</span> <span class="identifier">a9</span><span class="special">);</span>
+
+ <span class="identifier">task</span><span class="special">(</span> <span class="identifier">task</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">);</span>
+ <span class="identifier">task</span> <span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span> <span class="identifier">task</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">);</span>
+ <span class="identifier">task</span> <span class="special">&amp;&amp;</span> <span class="identifier">move</span><span class="special">();</span>
+
+ <span class="identifier">shared_future</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">get_future</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()();</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Cb</span> <span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="identifier">set_wait_callback</span><span class="special">(</span> <span class="identifier">Cb</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">cb</span><span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">other</span><span class="special">);</span>
+
+ <span class="keyword">operator</span> <span class="identifier">unspecified_bool_type</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.task.default_constructor"></a><h5>
+<a name="id664852"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.default_constructor">Default constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">task</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>
+ constructs an unitialized <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><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span></code>
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.constructor__function_pointer_"></a><h5>
+<a name="id664962"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.constructor__function_pointer_">Constructor
+ (function pointer)</a>
+ </h5>
+<pre class="programlisting"><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">fn</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>
+ 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</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span></code>
+ from a function pointer
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.constructor__functor_"></a><h5>
+<a name="id665099"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.constructor__functor_">Constructor
+ (functor)</a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Fn</span> <span class="special">&gt;</span>
+<span class="identifier">task</span><span class="special">(</span> <span class="identifier">Fn</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">fn</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>
+ 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</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span></code>
+ from a function object
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.constructor__functor_with_arguments_"></a><h5>
+<a name="id665262"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.constructor__functor_with_arguments_">Constructor
+ (functor with arguments)</a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+<span class="identifier">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">&lt;</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">A9</span> <span class="special">&gt;</span>
+<span class="identifier">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">A9</span> <span class="identifier">a9</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>
+ 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</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span></code>
+ from a function object and its arguments
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.move_copy_constructor"></a><h5>
+<a name="id665578"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.move_copy_constructor">Move-copy
+ constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">task</span><span class="special">(</span> <span class="identifier">task</span> <span class="special">&amp;&amp;)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<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</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span></code>
+ from another task taking over the ownership
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.move_assignment_operator"></a><h5>
+<a name="id665699"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.move_assignment_operator">Move-assignment
+ operator</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">task</span> <span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span> <span class="identifier">task</span> <span class="special">&amp;&amp;)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<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</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span></code>
+ from another task taking over the ownership
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.member_function__code__phrase_role__identifier__move__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id665833"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.member_function__code__phrase_role__identifier__move__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">move</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="identifier">task</span> <span class="special">&amp;&amp;</span> <span class="identifier">move</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>
+ moves task releasing the ownership
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</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="id665927"></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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;</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 future assiciated with the task
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.member_function__code__phrase_role__keyword__operator__phrase__phrase_role__special________phrase___code_"></a><h5>
+<a name="id666036"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ executes task's internal function object
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.member_template_function__code__phrase_role__identifier__set_wait_callback__phrase__phrase_role__special_____phrase___phrase_role__identifier__cb__phrase___phrase_role__identifier__cons__phrase__phrase_role__special___amp____phrase___code_"></a><h5>
+<a name="id666123"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.member_template_function__code__phrase_role__identifier__set_wait_callback__phrase__phrase_role__special_____phrase___phrase_role__identifier__cb__phrase___phrase_role__identifier__cons__phrase__phrase_role__special___amp____phrase___code_">Member
+ template-function <code class="computeroutput"><span class="identifier">set_wait_callback</span><span class="special">(</span> <span class="identifier">Cb</span> <span class="identifier">cons</span><span class="special">&amp;)</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Cb</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">set_wait_callback</span><span class="special">(</span> <span class="identifier">Cb</span> <span class="keyword">const</span> <span class="identifier">cb</span><span class="special">&amp;);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ stores callback function object which will be called if task would block
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.member_function__code__phrase_role__identifier__swap__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__special___amp____phrase___code_"></a><h5>
+<a name="id666281"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.member_function__code__phrase_role__identifier__swap__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__special___amp____phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">swap</span><span class="special">(</span>
+ <span class="identifier">task</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;)</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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">other</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>
+ swaps the task
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.operator__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__unspecified_bool_type__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id666441"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.operator__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__unspecified_bool_type__phrase__phrase_role__special______phrase___code_">operator
+ <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">unspecified_bool_type</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">unspecified_bool_type</span><span class="special">()</span> <span class="keyword">const</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ is task valid == does task own ownership
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.task.operator__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___code_"></a><h5>
+<a name="id666540"></a>
+ <a class="link" href="reference.html#boost_task.reference.task.operator__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___code_">operator
+ <code class="computeroutput"><span class="keyword">operator</span><span class="special">!()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ is task invalid == task does not have ownership
+ </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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">handle</span>
+<span class="special">{</span>
+ <span class="identifier">handle</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">interrupt</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">interrupt_and_wait</span><span class="special">();</span>
+ <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">&amp;</span> <span class="identifier">abs_time</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Duration</span> <span class="special">&gt;</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">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+ <span class="keyword">bool</span> <span class="identifier">interruption_requested</span><span class="special">();</span>
+
+ <span class="identifier">R</span> <span class="identifier">get</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">is_ready</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">bool</span> <span class="identifier">has_value</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">bool</span> <span class="identifier">has_exception</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;</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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">other</span><span class="special">);</span>
+<span class="special">};</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Iterator</span> <span class="special">&gt;</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">&lt;</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">&gt;</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">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">T2</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">);</span>
+<span class="special">...</span>
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</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">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="s
pecial">&amp;</span> <span class="identifier">t4</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T5</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t5</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Iterator</span> <span class="special">&gt;</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">&lt;</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">&gt;</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">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">);</span>
+<span class="special">...</span>
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</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">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class
="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t4</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T5</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t5</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.handle.constructor"></a><h5>
+<a name="id668168"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ constructs an empty (invalid) handle
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</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="id668235"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ checks if interruption is already requested
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__interrupt__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id668323"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ requests task interruption; doesn not block (immediatly returns)
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<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="id668412"></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>
+ </h5>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt_and_wait</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>
+ requests task interruption and blocks until worker-thread stops task
+ </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">thread_resource_error</span></code>
+ </p></dd>
+</dl>
+</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="id668520"></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">bool</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">&amp;</span> <span class="identifier">abs_time</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>
+ requests task interruption and blocks until worker-thread stops task
+ or time-point elapsed
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ false if the the time specified by abs_time was reached, true otherwise
+ </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">thread_resource_error</span></code>
+ </p></dd>
+</dl>
+</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="id668667"></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">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Duration</span> <span class="special">&gt;</span>
+<span class="keyword">bool</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">&amp;</span> <span class="identifier">rel_time</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>
+ requests task interruption and blocks until worker-thread stops task
+ or time-duration elapsed
+ </p></dd>
+<dt><span class="term">Returns:</span></dt>
+<dd><p>
+ false if the the time specified by rel_time was reached, true otherwise
+ </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">thread_resource_error</span></code>
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__get__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id668841"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ requests the result
+ </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_interrupted</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">task_uninialized</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">task_rejected</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">broken_task</span></code>
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id669042"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ blocks caller until task is done
+ </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_interrupted</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">task_uninialized</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">task_rejected</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">broken_task</span></code>
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait_for__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id669243"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__wait_for__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">wait_for</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Duration</span> <span class="special">&gt;</span>
+<span class="keyword">bool</span> <span class="identifier">wait_for</span><span class="special">(</span> <span class="identifier">Duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">)</span> <span class="keyword">const</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ blocks caller until task is done
+ </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_interrupted</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">task_uninialized</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">task_rejected</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">broken_task</span></code>
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__wait_until__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id669504"></a>
+ <a class="link" href="reference.html#boost_task.reference.handle.member_function__code__phrase_role__identifier__wait_until__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">wait_until</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">wait_until</span><span class="special">(</span> <span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">abs_time</span><span class="special">)</span> <span class="keyword">const</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ blocks caller until task is done
+ </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_interrupted</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">task_uninialized</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">task_rejected</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">broken_task</span></code>
+ </p></dd>
+</dl>
+</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="id669738"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ checks if task is done
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</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="id669825"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ 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>
+</dl>
+</div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__has_exception__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id669913"></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>
+ </h5>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">has_exception</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>
+ checks if task is done and an exception is set
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ 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="id670002"></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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;</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&lt; R &gt;
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.handle.member_function__code__phrase_role__identifier__swap__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id670112"></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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">other</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>
+ swapps handle
+ </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_all__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id670238"></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">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Iterator</span> <span class="special">&gt;</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">&lt;</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">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">T1</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">T2</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t3</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="id
entifier">t4</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">waitfor_all</span><span class="special">(</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="id
entifier">t4</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T5</span> <span class="special">&gt;</span> <span class="special">&amp;</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>
+ <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_interrupted</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">task_rejected</span></code>
+ </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="id671259"></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">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Iterator</span> <span class="special">&gt;</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">&lt;</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">&gt;</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">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</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">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t3</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</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">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="
special">&amp;</span> <span class="identifier">t4</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</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">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t2</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">t3</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="
special">&amp;</span> <span class="identifier">t4</span><span class="special">,</span> <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">T5</span> <span class="special">&gt;</span> <span class="special">&amp;</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>
+ <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_interrupted</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">task_rejected</span></code>,
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function async( task&lt; R &gt; &amp;&amp;, 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="Non-member function async( task&lt; R &gt; &amp;&amp;, EP)"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</span> <span class="identifier">EP</span><span class="special">)</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+<span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</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>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ moves task to an asyncrounous executer and returns a handle associated
+ with the task
+ </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">thread_resource_error</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function async( task&lt; R &gt; &amp;&amp;, pool&lt; Channel &gt; &amp;)">
+<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&lt; R &gt; &amp;&amp;, pool&lt; Channel &gt; &amp;)"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</span> <span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;</span> <span class="special">&amp;)</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+<span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">,</span> <span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">ep</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ moves task into a thread-pool and returns a handle associated with the
+ task
+ </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>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function async( task&lt; R &gt; &amp;&amp;, Attr, pool&lt; Channel &gt; &amp;)">
+<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&lt; R &gt; &amp;&amp;, Attr, pool&lt; Channel &gt; &amp;)"> Non-member function <code class="computeroutput"><span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</span> <span class="identifier">Attr</span><span class="special">,</span> <span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">Channel</span> <span class="special">&gt;</span>
+ <span class="special">&amp;)</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+<span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="identifier">async</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</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">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;</span> <span class="special">&amp;</span> <span class="identifier">ep</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ moves attributed task into a thread-pool and returns a handle associated
+ with the task
+ </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>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
+
+<span class="keyword">struct</span> <span class="identifier">own_thread</span>
+<span class="special">{</span>
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<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__special___amp__amp____phrase___code_"></a><h5>
+<a name="id673593"></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__special___amp__amp____phrase___code_">Member
+ function <code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span>
+ <span class="identifier">task</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;)</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+<span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</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>
+ moves 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>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
+
+<span class="keyword">struct</span> <span class="identifier">new_thread</span>
+<span class="special">{</span>
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<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__special___amp__amp____phrase___code_"></a><h5>
+<a name="id673985"></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__special___amp__amp____phrase___code_">Member
+ function <code class="computeroutput"><span class="keyword">operator</span><span class="special">()(</span>
+ <span class="identifier">task</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;)</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+<span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="keyword">operator</span><span class="special">()(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</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>
+ moves task in a new thread an returns an handle associated with the task
+ </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">thread_resource_error</span></code>
+ </p></dd>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">static_pool</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Channel</span> <span class="special">&gt;</span>
+ <span class="keyword">class</span> <span class="identifier">static_pool</span> <span class="special">:</span> <span class="keyword">private</span> <span class="identifier">noncopyable</span>
+ <span class="special">{</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">static_pool</span><span class="special">();</span>
+
+ <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">&amp;</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">&amp;</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">&amp;</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>
+
+ <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">&amp;</span> <span class="identifier">psize</span><span class="special">,</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">,</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</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">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">100</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</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>
+
+ <span class="identifier">static_pool</span><span class="special">(</span> <span class="identifier">static_pool</span> <span class="special">&amp;&amp;);</span>
+
+ <span class="identifier">static_pool</span> <span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span> <span class="identifier">static_pool</span> <span class="special">&amp;&amp;);</span>
+
+<span class="preprocessor"># if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_HAS_PROCESSOR_BINDINGS</span><span class="special">)</span>
+ <span class="keyword">explicit</span> <span class="identifier">static_pool</span><span class="special">(</span>
+ <span class="special">&lt;&lt;</span><span class="identifier">unspec</span><span class="special">-</span><span class="identifier">type</span><span class="special">&gt;&gt;,</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">&amp;</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">&amp;</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>
+
+ <span class="keyword">explicit</span> <span class="identifier">static_pool</span><span class="special">(</span>
+ <span class="special">&lt;&lt;</span><span class="identifier">unspec</span><span class="special">-</span><span class="identifier">type</span><span class="special">&gt;&gt;,</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">,</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</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">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">100</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</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>
+
+ <span class="keyword">static</span> <span class="special">&lt;&lt;</span><span class="identifier">unspec</span><span class="special">-</span><span class="identifier">type</span><span class="special">&gt;&gt;</span> <span class="identifier">bind_to_processors</span><span class="special">();</span>
+<span class="preprocessor"># endif</span>
+
+ <span class="special">~</span><span class="identifier">static_pool</span><span class="special">();</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">active</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">idle</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">shutdown</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">shutdown_now</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">interrupt_all_worker</span><span class="special">();</span>
+
+ <span class="keyword">bool</span> <span class="identifier">closed</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">clear</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pending</span><span class="special">();</span>
+
+ <span class="keyword">const</span> <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>
+ <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">&amp;</span> <span class="identifier">hwm</span><span class="special">);</span>
+ <span class="keyword">const</span> <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>
+ <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">&amp;</span> <span class="identifier">lwm</span><span class="special">);</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">);</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+ <span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">attr</span><span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span> <span class="identifier">static_pool</span> <span class="special">&amp;</span> <span class="identifier">other</span><span class="special">);</span>
+
+ <span class="keyword">operator</span> <span class="identifier">unspecified_bool_type</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.static_pool.default_constructor"></a><h5>
+<a name="id675921"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.default_constructor">Default
+ constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">static_pool</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>
+ constructs an unitialized pool
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.constructor__unbounded_channel_"></a><h5>
+<a name="id675988"></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="special">&lt;&lt;</span><span class="identifier">unspec</span><span class="special">-</span><span class="identifier">type</span><span class="special">&gt;&gt;,</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">&amp;</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">&amp;</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>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ operating system provides functionality for processor binding
+ </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>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</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_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 and <code class="computeroutput"><span class="identifier">bind_to_processors</span><span class="special">()</span></code>
+ must be set as first argument
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.constructor__unbounded_channel_poolsize_"></a><h5>
+<a name="id676321"></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">&amp;</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">&amp;</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">&amp;</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>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<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>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</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_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>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.constructor__bounded_channel_"></a><h5>
+<a name="id676627"></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="special">&lt;&lt;</span><span class="identifier">unspec</span><span class="special">-</span><span class="identifier">type</span><span class="special">&gt;&gt;,</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">,</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</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">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">100</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</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>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ operating system provides functionality for processor binding
+ </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>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</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_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 and <code class="computeroutput"><span class="identifier">bind_to_processors</span><span class="special">()</span></code>
+ must be set as first argument
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.constructor__bounded_channel_poolsize_"></a><h5>
+<a name="id677040"></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">&amp;</span> <span class="identifier">psize</span><span class="special">,</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">,</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</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">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">100</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</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>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<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>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</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_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>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.move_copy_constructor"></a><h5>
+<a name="id677427"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.move_copy_constructor">Move-copy
+ constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">static_pool</span><span class="special">(</span> <span class="identifier">static_pool</span> <span class="special">&amp;&amp;)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ creates an pool out of another one which gets zeroed out
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.move_assigment_constructor"></a><h5>
+<a name="id677504"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.move_assigment_constructor">Move-assigment
+ constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">static_pool</span> <span class="special">&amp;</span> <span class="keyword">operator</span><span class="special">=(</span> <span class="identifier">static_pool</span> <span class="special">&amp;&amp;)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ creates an pool out of another one which gets zeroed out
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.destructor"></a><h5>
+<a name="id677594"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ calls <code class="computeroutput"><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>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.static_member_function__code__phrase_role__identifier__bind_to_processors__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id677681"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.static_member_function__code__phrase_role__identifier__bind_to_processors__phrase__phrase_role__special______phrase___code_">Static
+ member function <code class="computeroutput"><span class="identifier">bind_to_processors</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="special">&lt;&lt;</span><span class="identifier">unspec</span><span class="special">-</span><span class="identifier">type</span><span class="special">&gt;&gt;</span> <span class="identifier">bind_to_processors</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>
+ used in order to let the pool create worker-threads as cores are available
+ and bound the threads to the cores
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</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="id677789"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns how many worker-threads are running in the pool
+ </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">pool_moved</span></code>
+ </p></dd>
+</dl>
+</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="id677915"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns how many worker-threads are active (executing an task)
+ </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">pool_moved</span></code>
+ </p></dd>
+</dl>
+</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="id678039"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns how many worker-threads are idle (not executing an task).
+ </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">pool_moved</span></code>
+ </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>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__shutdown__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id678207"></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>
+ </h5>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">shutdown</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>
+ deactivates the channel and joins all worker-threads - the pool is closed
+ </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">thread_interrupted</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">system_error</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">pool_moved</span></code>
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ all pending tasks are processed
+ </p></dd>
+</dl>
+</div>
+<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="id678384"></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>
+ </h5>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">shutdown_now</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>
+ 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>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_interrupted</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">system_error</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">pool_moved</span></code>
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ pending tasks are not processed but returned
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__interrupt_all_worker__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id678561"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function__code__phrase_role__identifier__interrupt_all_worker__phrase__phrase_role__special______phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">interrupt_all_worker</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt_all_worker</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>
+ interrupts all worker-threads without invalidating the pool
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</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="id678650"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ queries if the pool is closed (pool is shutdown)
+ </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">pool_moved</span></code>
+ </p></dd>
+</dl>
+</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="id678766"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ removes all pending tasks from the channel
+ </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">pool_moved</span></code>
+ </p></dd>
+</dl>
+</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="id678882"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ queries if the channel is empty
+ </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">pool_moved</span></code>
+ </p></dd>
+</dl>
+</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="id678998"></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">
+<p class="title"><b></b></p>
+<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>
+<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">pool_moved</span></code>
+ </p></dd>
+</dl>
+</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="id679123"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ 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>
+<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">pool_moved</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>
+</dl>
+</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="id679272"></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">&amp;</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">&amp;</span> <span class="identifier">hwm</span><span class="special">)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ 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>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</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>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">pool_moved</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>
+</dl>
+</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="id679549"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ 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>
+<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">pool_moved</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>
+</dl>
+</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="id679699"></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">&amp;</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">&amp;</span> <span class="identifier">lwm</span><span class="special">)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ 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>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</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>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">pool_moved</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>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__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__special___amp__amp____phrase___code_"></a><h5>
+<a name="id679974"></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__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__special___amp__amp____phrase___code_">Member
+ function <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
+ <span class="identifier">task</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;)</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+<span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ has_attribute&lt; pool &gt;::value == false &amp;&amp; ! closed()
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ moves 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>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">pool_moved</span></code>
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.member_function__code__phrase_role__identifier__submit__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__special___amp__amp____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="id680249"></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__task__phrase__phrase_role__special___lt___phrase___phrase_role__identifier__r__phrase___phrase_role__special___gt___phrase___phrase_role__special___amp__amp____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">task</span><span class="special">&lt;</span>
+ <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</span> <span class="identifier">Attr</span>
+ <span class="keyword">const</span><span class="special">&amp;</span>
+ <span class="identifier">attr</span><span class="special">)</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</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">&gt;</span>
+<span class="identifier">handle</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="special">&amp;&amp;</span> <span class="identifier">t</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">attr</span><span class="special">)</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ has_attribute&lt; pool &gt;::value == true &amp;&amp; ! closed()
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ moves 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>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">pool_moved</span></code>
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.member_function_swap__static_pool__amp___"></a><h5>
+<a name="id680595"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.member_function_swap__static_pool__amp___">Member
+ function swap( static_pool &amp;)`</a>
+ </h5>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">swap</span><span class="special">(</span> <span class="identifier">static_pool</span> <span class="special">&amp;</span> <span class="identifier">other</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>
+ swaps pool
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.operator__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__unspecified_bool_type__phrase__phrase_role__special______phrase___code_"></a><h5>
+<a name="id680691"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.operator__code__phrase_role__keyword__operator__phrase___phrase_role__identifier__unspecified_bool_type__phrase__phrase_role__special______phrase___code_">operator
+ <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">unspecified_bool_type</span><span class="special">()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">unspecified_bool_type</span><span class="special">()</span> <span class="keyword">const</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ is static_pool valid == does static_pool own ownership
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+<a name="boost_task.reference.static_pool.operator__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___code_"></a><h5>
+<a name="id680791"></a>
+ <a class="link" href="reference.html#boost_task.reference.static_pool.operator__code__phrase_role__keyword__operator__phrase__phrase_role__special_______phrase___code_">operator
+ <code class="computeroutput"><span class="keyword">operator</span><span class="special">!()</span></code></a>
+ </h5>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!()</span> <span class="keyword">const</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ is static_pool invalid == static_pool does not have ownership
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function reschedule_until()">
+<div class="titlepage"><div><div><h3 class="title">
+<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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pred</span> <span class="special">&gt;</span>
+<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">&amp;)</span>
+</pre>
+<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></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">thread_interrupted</span></code>,<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">system_error</span></code>
+ </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>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function get_pool()">
+<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">&lt;</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">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pool</span> <span class="special">&gt;</span>
+<span class="identifier">Pool</span> <span class="special">&amp;</span> <span class="identifier">get_pool</span><span class="special">()</span>
+</pre>
+<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></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><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>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function runs_in_pool()">
+<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">&lt;</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">&gt;</span>
+
+<span class="keyword">bool</span> <span class="identifier">runs_in_pool</span><span class="special">()</span>
+</pre>
+<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></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><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>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function worker_id()">
+<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">&lt;</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">&gt;</span>
+
+<span class="identifier">id</span> <span class="identifier">worker_id</span><span class="special">()</span>
+</pre>
+<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></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><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>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function delay()">
+<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">&lt;</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">&gt;</span>
+
+<span class="keyword">void</span> <span class="identifier">delay</span><span class="special">(</span> <span class="identifier">system_time</span> <span class="identifier">abs_time</span><span class="special">)</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Duration</span> <span class="special">&gt;</span>
+<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">&amp;</span> <span class="identifier">rel_time</span><span class="special">)</span>
+</pre>
+<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></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><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>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function yield()">
+<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">&lt;</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">&gt;</span>
+
+<span class="keyword">void</span> <span class="identifier">yield</span><span class="special">()</span>
+</pre>
+<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></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><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>
+</dl>
+</div>
+</div>
+<div class="section" title="Non-member function interrupt()">
+<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">&lt;</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">&gt;</span>
+
+<span class="keyword">void</span> <span class="identifier">interrupt</span><span class="special">()</span>
+</pre>
+<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></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><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>
+</dl>
+</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>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">meta</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pool</span> <span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">has_attribute</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">mpl</span><span class="special">::</span><span class="identifier">bool_</span><span class="special">&lt;</span>
+ <span class="identifier">is_same</span><span class="special">&lt;</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">has_priority</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Pool</span><span class="special">::</span><span class="identifier">scheduler_type</span><span class="special">::</span><span class="identifier">priority_tag_type</span>
+ <span class="special">&gt;::</span><span class="identifier">value</span>
+<span class="special">&gt;</span>
+<span class="special">{};</span>
+</pre>
+<p>
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns true if Pool supports attributes (priority-scheduling)
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Meta function attribute_type">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.attribute_type"></a><a class="link" href="reference.html#boost_task.reference.attribute_type" title="Meta function attribute_type"> Meta function
+ <code class="computeroutput"><span class="identifier">attribute_type</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">meta</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pool</span> <span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">attribute_type</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Pool</span><span class="special">::</span><span class="identifier">scheduler_type</span><span class="special">::</span><span class="identifier">attribute_type</span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns type of attribute
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">poolsize</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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>
+
+ <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><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.poolsize.constructor"></a><h5>
+<a name="id682905"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ value &gt; 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>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ operator std::size_t () &gt; 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>
+</dl>
+</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="id596678"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns the value
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">watermark</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">high_watermark</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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>
+
+ <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><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.high_watermark.constructor"></a><h5>
+<a name="id683462"></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">
+<p class="title"><b></b></p>
+<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>
+<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>
+</dl>
+</div>
+<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="id683614"></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>
+ </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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns high watermark
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">watermark</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">low_watermark</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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>
+
+ <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><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.low_watermark.constructor"></a><h5>
+<a name="id683927"></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">
+<p class="title"><b></b></p>
+<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>
+<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>
+</dl>
+</div>
+<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="id684080"></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>
+ </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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns low watermark
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">scanns</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">scanns</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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>
+
+ <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><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.scanns.constructor"></a><h5>
+<a name="id684393"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ value &gt; 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>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ operator std::size_t () &gt; 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>
+</dl>
+</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="id684570"></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">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ returns the value
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Class invalid_poolsize">
+<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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">invalid_poolsize</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.invalid_poolsize.constructor"></a><h5>
+<a name="id684876"></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">&amp;</span> <span class="identifier">msg</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>
+ 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>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">invalid_scanns</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.invalid_scanns.constructor"></a><h5>
+<a name="id685189"></a>
+ <a class="link" href="reference.html#boost_task.reference.invalid_scanns.constructor">Constructor</a>
+ </h5>
+<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">&amp;</span> <span class="identifier">msg</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>
+ 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>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">invalid_timeduration</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.invalid_timeduration.constructor"></a><h5>
+<a name="id685503"></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">&amp;</span> <span class="identifier">msg</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>
+ 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>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">invalid_watermark</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.invalid_watermark.constructor"></a><h5>
+<a name="id685817"></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">&amp;</span> <span class="identifier">msg</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>
+ 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>
+</dl>
+</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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">task_rejected</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <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">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.task_rejected.constructor"></a><h5>
+<a name="id686131"></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">&amp;</span> <span class="identifier">msg</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>
+ 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>
+</dl>
+</div>
+</div>
+<div class="section" title="Class task_unitialized">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.task_unitialized"></a><a class="link" href="reference.html#boost_task.reference.task_unitialized" title="Class task_unitialized"> Class <code class="computeroutput"><span class="identifier">task_unitialized</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">task_unitialized</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">logic_error</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">task_unitialized</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.task_unitialized.constructor"></a><h5>
+<a name="id686410"></a>
+ <a class="link" href="reference.html#boost_task.reference.task_unitialized.constructor">Constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">task_unitialized</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>
+ 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_unitialized</span></code> instance
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Class task_already_executed">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.task_already_executed"></a><a class="link" href="reference.html#boost_task.reference.task_already_executed" title="Class task_already_executed"> Class <code class="computeroutput"><span class="identifier">task_already_executed</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">task_already_executed</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">logic_error</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">task_already_executed</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.task_already_executed.constructor"></a><h5>
+<a name="id686655"></a>
+ <a class="link" href="reference.html#boost_task.reference.task_already_executed.constructor">Constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">task_already_executed</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>
+ 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_already_executed</span></code> instance
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Class task_moved">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.task_moved"></a><a class="link" href="reference.html#boost_task.reference.task_moved" title="Class task_moved"> Class <code class="computeroutput"><span class="identifier">task_moved</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">task_moved</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">logic_error</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">task_moved</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.task_moved.constructor"></a><h5>
+<a name="id686899"></a>
+ <a class="link" href="reference.html#boost_task.reference.task_moved.constructor">Constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">task_moved</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>
+ 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_moved</span></code> instance
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Class broken_task">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.broken_task"></a><a class="link" href="reference.html#boost_task.reference.broken_task" title="Class broken_task"> Class <code class="computeroutput"><span class="identifier">broken_task</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">broken_task</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">logic_error</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">broken_task</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.broken_task.constructor"></a><h5>
+<a name="id687144"></a>
+ <a class="link" href="reference.html#boost_task.reference.broken_task.constructor">Constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">broken_task</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>
+ 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">broken_task</span></code> instance
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Class task_interrupted">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.task_interrupted"></a><a class="link" href="reference.html#boost_task.reference.task_interrupted" title="Class task_interrupted"> Class <code class="computeroutput"><span class="identifier">task_interrupted</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">task_interrupted</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">task_interrupted</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.task_interrupted.constructor"></a><h5>
+<a name="id687387"></a>
+ <a class="link" href="reference.html#boost_task.reference.task_interrupted.constructor">Constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">task_interrupted</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>
+ 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_interrupted</span></code> instance
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" title="Class pool_moved">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_task.reference.pool_moved"></a><a class="link" href="reference.html#boost_task.reference.pool_moved" title="Class pool_moved"> Class <code class="computeroutput"><span class="identifier">pool_moved</span></code></a>
+</h3></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">task</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">pool_moved</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">logic_error</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">pool_moved</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<a name="boost_task.reference.pool_moved.constructor"></a><h5>
+<a name="id687632"></a>
+ <a class="link" href="reference.html#boost_task.reference.pool_moved.constructor">Constructor</a>
+ </h5>
+<pre class="programlisting"><span class="identifier">pool_moved</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>
+ 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">pool_moved</span></code> instance
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ nothing
+ </p></dd>
+</dl>
+</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>
+ 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="meta_functions.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="appendices.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/boost_task/task.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/task.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,292 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Task</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="motivation.html" title="Motivation">
+<link rel="next" href="handle.html" title="Handle">
+</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="motivation.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="handle.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Task">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.task"></a><a class="link" href="task.html" title="Task"> Task</a>
+</h2></div></div></div>
+<p>
+ A task is a chunk of code that can be executed independently.
+ </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">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>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. <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> supports move semantics (moving ownership).
+ </p>
+<a name="boost_task.task.cooperative_task_and_interruption"></a><h4>
+<a name="id643366"></a>
+ <a class="link" href="task.html#boost_task.task.cooperative_task_and_interruption">Cooperative
+ task and interruption</a>
+ </h4>
+<p>
+ Sometimes it is desired to stop a running task if it is no longer needed. In
+ this case the thread is not killed - it stops only at well-defined points (<span class="emphasis"><em>interruption-points</em></span>)
+ 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="id643417" href="#ftn.id643417" class="footnote">2</a>]</sup>
+ .
+ </p>
+<p>
+ <span class="emphasis"><em>interruption-points</em></span> are:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">join</span><span class="special">()</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">timed_join</span><span class="special">()</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable</span><span class="special">::</span><span class="identifier">wait</span><span class="special">()</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable</span><span class="special">::</span><span class="identifier">timed_wait</span><span class="special">()</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span><span class="special">::</span><span class="identifier">wait</span><span class="special">()</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span><span class="special">::</span><span class="identifier">timed_wait</span><span class="special">()</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">()</span></code></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">sleep</span><span class="special">()</span></code></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_point</span><span class="special">()</span></code></li>
+</ul></div>
+<p>
+ A <span class="emphasis"><em>interruption-point</em></span> throws <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_interrupted</span></code> if an interruption was requested.
+ </p>
+<p>
+
+</p>
+<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="comment">// interruption point
+</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="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">&lt;=</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="comment">// check if interruption was requested
+</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="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="comment">// interruption point
+</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="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="comment">// task for computing fibonacci-number
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</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="comment">// execute task in new thread
+</span> <span class="comment">// move task ownership to executor
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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">// interrupt task an wait until
+</span> <span class="comment">// the task is removed by the worker-thread
+</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">interrupt_and_wait</span><span class="special">();</span>
+
+ <span class="comment">// access the result
+</span> <span class="comment">// throws boost::task::task_interrupted
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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.task.exceptions"></a><h4>
+<a name="id644579"></a>
+ <a class="link" href="task.html#boost_task.task.exceptions">Exceptions</a>
+ </h4>
+<p>
+ Exceptions thrown 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">task</span></code> are transported by the <span class="emphasis"><em>asynchronous-completion-token</em></span>.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">throwing</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="special">...</span>
+ <span class="keyword">throw</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">domain_error</span><span class="special">(</span><span class="string">"domain error"</span><span class="special">);</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="comment">// create task throwing std::domain_error
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span> <span class="keyword">void</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span> <span class="identifier">throwing</span><span class="special">);</span>
+
+ <span class="comment">// execute task asynchron
+</span> <span class="comment">// move task ownership to executor
+</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">&lt;</span> <span class="keyword">void</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t</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">// wait for task completion
+</span> <span class="comment">// throws std::domain_error
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">wait</span><span class="special">()</span> <span class="special">&lt;&lt;</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>
+ Exceptions rethrown by type are:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_cast</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_exception</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_typeid</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">domain_error</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failure</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">logic_error</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">out_of_range</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">overflow_error</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">range_error</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">underflow_error</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">exception</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">future_already_set</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">future_cancel</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">invalid_thread_argument</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_error</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">broken_task</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">pool_moved</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task_already_executed</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task_interrupted</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task_moved</span></code></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">task_interrupted</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task_task_rejected</span></code></li>
+<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">task_unitialized</span></code></li>
+</ul></div>
+<a name="boost_task.task.parent_task"></a><h4>
+<a name="id645550"></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>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
+ strategies for fast execution of unordered <span class="emphasis"><em>work-items</em></span>
+ as <a class="link" href="pool.html#boost_task.pool.work_stealing" title="Work-Stealing"><span class="emphasis"><em>work-stealing</em></span></a>).
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="identifier">serial_fib</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">&lt;</span> <span class="number">2</span><span class="special">)</span> <span class="keyword">return</span> <span class="identifier">n</span><span class="special">;</span>
+ <span class="keyword">else</span> <span class="keyword">return</span> <span class="identifier">serial_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="special">+</span> <span class="identifier">serial_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="special">}</span>
+
+<span class="keyword">long</span> <span class="identifier">parallel_fib</span><span class="special">(</span> <span class="keyword">long</span> <span class="identifier">n</span><span class="special">,</span> <span class="keyword">long</span> <span class="identifier">cutof</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">&lt;</span> <span class="identifier">cutof</span><span class="special">)</span> <span class="keyword">return</span> <span class="identifier">serial_fib</span><span class="special">(</span> <span class="identifier">n</span><span class="special">);</span>
+ <span class="keyword">else</span>
+ <span class="special">{</span>
+ <span class="comment">// sub-task for computing fibonacci(n-1)
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t1</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="comment">// sub-task for computing fibonacci(n-2)
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t2</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="comment">// submit a sub-tasks to thread-pool
+</span> <span class="comment">// move task ownership to executor
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t1</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t2</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="comment">// computing fibonacci(n) by
+</span> <span class="comment">// joining 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>
+<span class="special">}</span>
+
+<span class="keyword">void</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="comment">// create thread-pool with five worker-threads
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">fifo</span>
+ <span class="special">&gt;</span>
+ <span class="special">&gt;</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="comment">// create task computing fibonacci-number for 10
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+ <span class="identifier">parallel_fib</span><span class="special">,</span>
+ <span class="number">10</span><span class="special">,</span>
+ <span class="number">5</span><span class="special">);</span>
+
+ <span class="comment">// execute task asynchron in thread-pool
+</span> <span class="comment">// move task ownership to executor
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</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="special">);</span>
+
+ <span class="comment">// access result
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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.id643417" href="#id643417" class="para">2</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>
+<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="motivation.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="handle.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/boost_task/utilities.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boost_task/utilities.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,112 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Utilities</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<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="as_sub_task.html" title="Execute as sub-task">
+<link rel="next" href="meta_functions.html" title="Meta functions">
+</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="as_sub_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="meta_functions.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" title="Utilities">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.utilities"></a><a class="link" href="utilities.html" title="Utilities"> Utilities</a>
+</h2></div></div></div>
+<p>
+ <span class="bold"><strong>Boost.Task</strong></span> provides some free-functions which
+ can be used inside 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</span></code> to access some informations (like if
+ 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>
+ runs in a <span class="emphasis"><em>thread-pool</em></span>).
+ </p>
+<a name="boost_task.utilities.reschedule_until"></a><h4>
+<a name="id662954"></a>
+ <a class="link" href="utilities.html#boost_task.utilities.reschedule_until">reschedule_until</a>
+ </h4>
+<p>
+ In the function <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">reschedule_until</span><span class="special">(</span>
+ <span class="identifier">Pred</span> <span class="keyword">const</span><span class="special">&amp;)</span></code> allows to synchronize the task with other
+ asynchronous events without blocking the <span class="emphasis"><em>worker-threads</em></span>
+ (bool Pred::operator()() must not block). The current task will be rescheduled
+ until the passed predicate becomes true.
+ </p>
+<a name="boost_task.utilities.get_pool"></a><h4>
+<a name="id663030"></a>
+ <a class="link" href="utilities.html#boost_task.utilities.get_pool">get_pool</a>
+ </h4>
+<p>
+ The pool in which the current 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">task</span></code>) is executed can be accessed via <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">get_pool</span><span class="special">()</span></code>. If hte code is not executed by a <span class="emphasis"><em>worker-thread</em></span>
+ an assertion is raised.
+ </p>
+<a name="boost_task.utilities.runs_in_pool"></a><h4>
+<a name="id663119"></a>
+ <a class="link" href="utilities.html#boost_task.utilities.runs_in_pool">runs_in_pool</a>
+ </h4>
+<p>
+ In order to check if the current code is executed in a <span class="emphasis"><em>thread-pool</em></span>
+ <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">runs_in_pool</span><span class="special">()</span></code>
+ should be used.
+ </p>
+<a name="boost_task.utilities.worker_id"></a><h4>
+<a name="id663178"></a>
+ <a class="link" href="utilities.html#boost_task.utilities.worker_id">worker_id</a>
+ </h4>
+<p>
+ <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">worker_id</span><span class="special">()</span></code>
+ returns the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">id</span></code> of the <span class="emphasis"><em>worker-thread</em></span>
+ 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="id663294"></a>
+ <a class="link" href="utilities.html#boost_task.utilities.delay">delay</a>
+ </h4>
+<p>
+ The execution of 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</span></code>
+ 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="id663378"></a>
+ <a class="link" href="utilities.html#boost_task.utilities.yield">yield</a>
+ </h4>
+<p>
+ If 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</span></code>
+ detects that it would bould block it can yield itself 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">yield</span><span class="special">()</span></code>
+ so that the <span class="emphasis"><em>worker-thread</em></span> can execute another <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> in
+ the meantime.
+ </p>
+<a name="boost_task.utilities.interrupt"></a><h4>
+<a name="id663495"></a>
+ <a class="link" href="utilities.html#boost_task.utilities.interrupt">interrupt</a>
+ </h4>
+<p>
+ 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</span></code>
+ can interrupt itself via <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">interrupt</span><span class="special">()</span></code>.
+ </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="as_sub_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="meta_functions.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/boostbook.css
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/boostbook.css 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,594 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Distributed under the Boost Software License, Version 1.0. (See accompany-
+ ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*=============================================================================
+ Body defaults
+=============================================================================*/
+
+ body
+ {
+ margin: 1em;
+ font-family: sans-serif;
+ }
+
+/*=============================================================================
+ Paragraphs
+=============================================================================*/
+
+ p
+ {
+ text-align: left;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+/*=============================================================================
+ Program listings
+=============================================================================*/
+
+ /* Code on paragraphs */
+ p tt.computeroutput
+ {
+ font-size: 9pt;
+ }
+
+ pre.synopsis
+ {
+ font-size: 90%;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ .programlisting,
+ .screen
+ {
+ font-size: 9pt;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ /* Program listings in tables don't get borders */
+ td .programlisting,
+ td .screen
+ {
+ margin: 0pc 0pc 0pc 0pc;
+ padding: 0pc 0pc 0pc 0pc;
+ }
+
+/*=============================================================================
+ Headings
+=============================================================================*/
+
+ h1, h2, h3, h4, h5, h6
+ {
+ text-align: left;
+ margin: 1em 0em 0.5em 0em;
+ font-weight: bold;
+ }
+
+ h1 { font: 140% }
+ h2 { font: bold 140% }
+ h3 { font: bold 130% }
+ h4 { font: bold 120% }
+ h5 { font: italic 110% }
+ h6 { font: italic 100% }
+
+ /* Top page titles */
+ title,
+ h1.title,
+ h2.title
+ h3.title,
+ h4.title,
+ h5.title,
+ h6.title,
+ .refentrytitle
+ {
+ font-weight: bold;
+ margin-bottom: 1pc;
+ }
+
+ h1.title { font-size: 140% }
+ h2.title { font-size: 140% }
+ h3.title { font-size: 130% }
+ h4.title { font-size: 120% }
+ h5.title { font-size: 110% }
+ h6.title { font-size: 100% }
+
+ .section h1
+ {
+ margin: 0em 0em 0.5em 0em;
+ font-size: 140%;
+ }
+
+ .section h2 { font-size: 140% }
+ .section h3 { font-size: 130% }
+ .section h4 { font-size: 120% }
+ .section h5 { font-size: 110% }
+ .section h6 { font-size: 100% }
+
+ /* Code on titles */
+ h1 tt.computeroutput { font-size: 140% }
+ h2 tt.computeroutput { font-size: 140% }
+ h3 tt.computeroutput { font-size: 130% }
+ h4 tt.computeroutput { font-size: 120% }
+ h5 tt.computeroutput { font-size: 110% }
+ h6 tt.computeroutput { font-size: 100% }
+
+/*=============================================================================
+ Author
+=============================================================================*/
+
+ h3.author
+ {
+ font-size: 100%
+ }
+
+/*=============================================================================
+ Lists
+=============================================================================*/
+
+ li
+ {
+ font-size: 10pt;
+ line-height: 1.3;
+ }
+
+ /* Unordered lists */
+ ul
+ {
+ text-align: left;
+ }
+
+ /* Ordered lists */
+ ol
+ {
+ text-align: left;
+ }
+
+/*=============================================================================
+ Links
+=============================================================================*/
+
+ a
+ {
+ text-decoration: none; /* no underline */
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+/*=============================================================================
+ Spirit style navigation
+=============================================================================*/
+
+ .spirit-nav
+ {
+ text-align: right;
+ }
+
+ .spirit-nav a
+ {
+ color: white;
+ padding-left: 0.5em;
+ }
+
+ .spirit-nav img
+ {
+ border-width: 0px;
+ }
+
+/*=============================================================================
+ Copyright footer
+=============================================================================*/
+ .copyright-footer
+ {
+ text-align: right;
+ font-size: 70%;
+ }
+
+ .copyright-footer p
+ {
+ text-align: right;
+ font-size: 80%;
+ }
+
+/*=============================================================================
+ Table of contents
+=============================================================================*/
+
+ .toc
+ {
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.1pc 1pc 0.1pc 1pc;
+ font-size: 80%;
+ line-height: 1.15;
+ }
+
+ .boost-toc
+ {
+ float: right;
+ padding: 0.5pc;
+ }
+
+/*=============================================================================
+ Tables
+=============================================================================*/
+
+ .table-title,
+ div.table p.title
+ {
+ margin-left: 4%;
+ padding-right: 0.5em;
+ padding-left: 0.5em;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+ }
+
+ div.informaltable table,
+ div.table table
+ {
+ padding: 4px;
+ }
+
+ /* Table Cells */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ padding: 0.5em;
+ text-align: left;
+ font-size: 9pt;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ border: 1pt solid white;
+ font-size: 80%;
+ }
+
+ table.simplelist
+ {
+ width: auto !important;
+ margin: 0em !important;
+ padding: 0em !important;
+ border: none !important;
+ }
+ table.simplelist td
+ {
+ margin: 0em !important;
+ padding: 0em !important;
+ text-align: left !important;
+ font-size: 9pt !important;
+ border: none !important;
+ }
+
+/*=============================================================================
+ Blurbs
+=============================================================================*/
+
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ font-size: 9pt; /* A little bit smaller than the main text */
+ line-height: 1.2;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ p.blurb img
+ {
+ padding: 1pt;
+ }
+
+/*=============================================================================
+ Variable Lists
+=============================================================================*/
+
+ div.variablelist
+ {
+ margin: 1em 0;
+ }
+
+ /* Make the terms in definition lists bold */
+ div.variablelist dl dt,
+ span.term
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td
+ {
+ text-align: left;
+ vertical-align: top;
+ padding: 0em 2em 0em 0em;
+ font-size: 10pt;
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+ div.variablelist dl dt
+ {
+ margin-bottom: 0.2em;
+ }
+
+ div.variablelist dl dd
+ {
+ margin: 0em 0em 0.5em 2em;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td p,
+ div.variablelist dl dd p
+ {
+ margin: 0em 0em 0.5em 0em;
+ line-height: 1;
+ }
+
+/*=============================================================================
+ Misc
+=============================================================================*/
+
+ /* Title of books and articles in bibliographies */
+ span.title
+ {
+ font-style: italic;
+ }
+
+ span.underline
+ {
+ text-decoration: underline;
+ }
+
+ span.strikethrough
+ {
+ text-decoration: line-through;
+ }
+
+ /* Copyright, Legal Notice */
+ div div.legalnotice p
+ {
+ text-align: left
+ }
+
+/*=============================================================================
+ Colors
+=============================================================================*/
+
+ @media screen
+ {
+ body {
+ background-color: #FFFFFF;
+ color: #000000;
+ }
+
+ /* Links */
+ a
+ {
+ color: #005a9c;
+ }
+
+ a:visited
+ {
+ color: #9c5a9c;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
+ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
+ {
+ text-decoration: none; /* no underline */
+ color: #000000;
+ }
+
+ /* Syntax Highlighting */
+ .keyword { color: #0000AA; }
+ .identifier { color: #000000; }
+ .special { color: #707070; }
+ .preprocessor { color: #402080; }
+ .char { color: teal; }
+ .comment { color: #800000; }
+ .string { color: teal; }
+ .number { color: teal; }
+ .white_bkd { background-color: #FFFFFF; }
+ .dk_grey_bkd { background-color: #999999; }
+
+ /* Copyright, Legal Notice */
+ .copyright
+ {
+ color: #666666;
+ font-size: small;
+ }
+
+ div div.legalnotice p
+ {
+ color: #666666;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Blurbs */
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ background-color: #F0F0F0;
+ border: 1px solid #DCDCDC;
+ }
+
+ .copyright-footer
+ {
+ color: #8F8F8F;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ color: #00A000;
+ }
+ }
+
+ @media print
+ {
+ /* Links */
+ a
+ {
+ color: black;
+ }
+
+ a:visited
+ {
+ color: black;
+ }
+
+ .spirit-nav
+ {
+ display: none;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid gray;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid gray;
+ }
+
+ td .programlisting,
+ td .screen
+ {
+ border: 0px solid #DCDCDC;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid gray;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ border: 1px solid gray;
+ border-collapse: collapse;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid gray;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ border: 1px solid gray;
+ }
+
+ table.simplelist tr td
+ {
+ border: none !important;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ font-weight: bold;
+ }
+ }
+
+/*=============================================================================
+ Images
+=============================================================================*/
+
+ span.inlinemediaobject img
+ {
+ vertical-align: middle;
+ }
+
+/*==============================================================================
+ Super and Subscript: style so that line spacing isn't effected, see
+ http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=1&postId=5341
+==============================================================================*/
+
+sup,
+sub {
+ height: 0;
+ line-height: 1;
+ vertical-align: baseline;
+ _vertical-align: bottom;
+ position: relative;
+
+}
+
+sup {
+ bottom: 1ex;
+}
+
+sub {
+ top: .5ex;
+}
+

Added: sandbox/task/libs/task/doc/html/docutils.css
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/docutils.css 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,275 @@
+/*
+:Author: David Goodger
+:Contact: goodger_at_[hidden]
+:Date: $Date: 2007-11-25 19:34:32 +0000 (Sun, 25 Nov 2007) $
+:Revision: $Revision: 41371 $
+:Copyright: This stylesheet has been placed in the public domain.
+
+Default cascading style sheet for the HTML output of Docutils.
+
+See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
+customize this style sheet.
+*/
+
+/* used to remove borders from tables and images */
+.borderless, table.borderless td, table.borderless th {
+ border: 0 }
+
+table.borderless td, table.borderless th {
+ /* Override padding for "table.docutils td" with "! important".
+ The right padding separates the table cells. */
+ padding: 0 0.5em 0 0 ! important }
+
+.first {
+ /* Override more specific margin styles with "! important". */
+ margin-top: 0 ! important }
+
+.last, .with-subtitle {
+ margin-bottom: 0 ! important }
+
+.hidden {
+ display: none }
+
+a.toc-backref {
+ text-decoration: none ;
+ color: black }
+
+blockquote.epigraph {
+ margin: 2em 5em ; }
+
+dl.docutils dd {
+ margin-bottom: 0.5em }
+
+/* Uncomment (and remove this text!) to get bold-faced definition list terms
+dl.docutils dt {
+ font-weight: bold }
+*/
+
+div.abstract {
+ margin: 2em 5em }
+
+div.abstract p.topic-title {
+ font-weight: bold ;
+ text-align: center }
+
+div.admonition, div.attention, div.caution, div.danger, div.error,
+div.hint, div.important, div.note, div.tip, div.warning {
+ margin: 2em ;
+ border: medium outset ;
+ padding: 1em }
+
+div.admonition p.admonition-title, div.hint p.admonition-title,
+div.important p.admonition-title, div.note p.admonition-title,
+div.tip p.admonition-title {
+ font-weight: bold ;
+ font-family: sans-serif }
+
+div.attention p.admonition-title, div.caution p.admonition-title,
+div.danger p.admonition-title, div.error p.admonition-title,
+div.warning p.admonition-title {
+ color: red ;
+ font-weight: bold ;
+ font-family: sans-serif }
+
+/* Uncomment (and remove this text!) to get reduced vertical space in
+ compound paragraphs.
+div.compound .compound-first, div.compound .compound-middle {
+ margin-bottom: 0.5em }
+
+div.compound .compound-last, div.compound .compound-middle {
+ margin-top: 0.5em }
+*/
+
+div.dedication {
+ margin: 2em 5em ;
+ text-align: center ;
+ font-style: italic }
+
+div.dedication p.topic-title {
+ font-weight: bold ;
+ font-style: normal }
+
+div.figure {
+ margin-left: 2em ;
+ margin-right: 2em }
+
+div.footer, div.header {
+ clear: both;
+ font-size: smaller }
+
+div.line-block {
+ display: block ;
+ margin-top: 1em ;
+ margin-bottom: 1em }
+
+div.line-block div.line-block {
+ margin-top: 0 ;
+ margin-bottom: 0 ;
+ margin-left: 1.5em }
+
+div.sidebar {
+ margin-left: 1em ;
+ border: medium outset ;
+ padding: 1em ;
+ background-color: #ffffee ;
+ width: 40% ;
+ float: right ;
+ clear: right }
+
+div.sidebar p.rubric {
+ font-family: sans-serif ;
+ font-size: medium }
+
+div.system-messages {
+ margin: 5em }
+
+div.system-messages h1 {
+ color: red }
+
+div.system-message {
+ border: medium outset ;
+ padding: 1em }
+
+div.system-message p.system-message-title {
+ color: red ;
+ font-weight: bold }
+
+div.topic {
+ margin: 2em }
+
+h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
+h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
+ margin-top: 0.4em }
+
+h1.title {
+ text-align: center }
+
+h2.subtitle {
+ text-align: center }
+
+hr.docutils {
+ width: 75% }
+
+img.align-left {
+ clear: left }
+
+img.align-right {
+ clear: right }
+
+ol.simple, ul.simple {
+ margin-bottom: 1em }
+
+ol.arabic {
+ list-style: decimal }
+
+ol.loweralpha {
+ list-style: lower-alpha }
+
+ol.upperalpha {
+ list-style: upper-alpha }
+
+ol.lowerroman {
+ list-style: lower-roman }
+
+ol.upperroman {
+ list-style: upper-roman }
+
+p.attribution {
+ text-align: right ;
+ margin-left: 50% }
+
+p.caption {
+ font-style: italic }
+
+p.credits {
+ font-style: italic ;
+ font-size: smaller }
+
+p.label {
+ white-space: nowrap }
+
+p.rubric {
+ font-weight: bold ;
+ font-size: larger ;
+ color: maroon ;
+ text-align: center }
+
+p.sidebar-title {
+ font-family: sans-serif ;
+ font-weight: bold ;
+ font-size: larger }
+
+p.sidebar-subtitle {
+ font-family: sans-serif ;
+ font-weight: bold }
+
+p.topic-title {
+ font-weight: bold }
+
+pre.address {
+ margin-bottom: 0 ;
+ margin-top: 0 ;
+ font-family: serif ;
+ font-size: 100% }
+
+pre.literal-block, pre.doctest-block {
+ margin-left: 2em ;
+ margin-right: 2em }
+
+span.classifier {
+ font-family: sans-serif ;
+ font-style: oblique }
+
+span.classifier-delimiter {
+ font-family: sans-serif ;
+ font-weight: bold }
+
+span.interpreted {
+ font-family: sans-serif }
+
+span.option {
+ white-space: nowrap }
+
+span.pre {
+ white-space: pre }
+
+span.problematic {
+ color: red }
+
+span.section-subtitle {
+ /* font-size relative to parent (h1..h6 element) */
+ font-size: 80% }
+
+table.citation {
+ border-left: solid 1px gray;
+ margin-left: 1px }
+
+table.docinfo {
+ margin: 2em 4em }
+
+table.docutils {
+ margin-top: 0.5em ;
+ margin-bottom: 0.5em }
+
+table.footnote {
+ border-left: solid 1px black;
+ margin-left: 1px }
+
+table.docutils td, table.docutils th,
+table.docinfo td, table.docinfo th {
+ padding-left: 0.5em ;
+ padding-right: 0.5em ;
+ vertical-align: top }
+
+table.docutils th.field-name, table.docinfo th.docinfo-name {
+ font-weight: bold ;
+ text-align: left ;
+ white-space: nowrap ;
+ padding-left: 0 }
+
+h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
+h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
+ font-size: 100% }
+
+ul.auto-toc {
+ list-style-type: none }

Added: sandbox/task/libs/task/doc/html/images/accumulators/doxygen.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_0.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_1.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_10.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_100.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_11.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_12.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_13.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_14.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_15.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_16.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_17.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_18.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_19.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_2.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_20.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_21.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_22.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_23.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_24.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_25.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_26.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_27.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_28.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_29.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_3.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_30.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_31.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_32.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_33.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_34.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_35.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_36.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_37.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_38.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_39.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_4.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_40.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_41.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_42.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_43.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_44.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_45.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_46.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_47.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_48.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_49.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_5.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_50.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_51.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_52.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_53.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_54.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_55.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_56.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_57.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_58.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_59.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_6.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_60.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_61.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_62.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_63.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_64.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_65.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_66.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_67.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_68.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_69.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_7.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_70.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_71.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_72.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_73.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_74.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_75.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_76.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_77.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_78.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_79.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_8.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_80.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_81.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_82.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_83.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_84.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_85.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_86.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_87.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_88.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_89.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_9.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_90.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_91.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_92.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_93.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_94.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_95.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_96.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_97.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_98.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/accumulators/form_99.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/alert.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/1.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/10.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/11.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/12.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/13.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/14.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/15.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/2.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/3.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/4.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/5.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/6.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/7.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/8.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/callouts/9.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/caution.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/draft.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/home.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/important.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/next.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/next_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/note.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/prev.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/prev_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/smiley.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/tip.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/toc-blank.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/toc-minus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/toc-plus.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/up.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/up_disabled.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/images/warning.png
==============================================================================
Binary file. No diff available.

Added: sandbox/task/libs/task/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/index.html 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,414 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Chapter 1. Boost.Task</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
+<link rel="home" href="index.html" title="Chapter 1. Boost.Task">
+<link rel="next" href="boost_task/motivation.html" title="Motivation">
+</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="n" href="boost_task/motivation.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="chapter" title="Chapter 1. Boost.Task">
+<div class="titlepage"><div>
+<div><h2 class="title">
+<a name="boost_task"></a>Chapter 1. Boost.Task</h2></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">Oliver</span> <span class="surname">Kowalke</span>
+</h3></div></div>
+<div><p class="copyright">Copyright © 2009 Oliver Kowalke</p></div>
+<div><div class="legalnotice" title="Legal Notice">
+<a name="id623344"></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>
+</div></div>
+</div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"> Overview</span></dt>
+<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>
+<dd><dl>
+<dt><span class="section"> Static thread-pool</span></dt>
+<dt><span class="section"> Channel</span></dt>
+<dt><span class="section"> Scheduling</span></dt>
+<dt><span class="section"> Pool shutdown</span></dt>
+<dt><span class="section"> Processor binding</span></dt>
+<dt><span class="section"> Work-Stealing</span></dt>
+<dt><span class="section"> Fork/Join</span></dt>
+</dl></dd>
+<dt><span class="section"> Execute as sub-task</span></dt>
+<dt><span class="section"> Utilities</span></dt>
+<dt><span class="section"> Meta functions</span></dt>
+<dt><span class="section"> Reference</span></dt>
+<dd><dl>
+<dt><span class="section"> Class template task</span></dt>
+<dt><span class="section"> Class template handle</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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</span> <span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;</span> <span class="special">&amp;)</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">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+ <span class="special">&amp;&amp;,</span> <span class="identifier">Attr</span><span class="special">,</span> <span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">Channel</span> <span class="special">&gt;</span>
+ <span class="special">&amp;)</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"><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>
+<dt><span class="section"> Class poolsize</span></dt>
+<dt><span class="section"> Class high_watermark</span></dt>
+<dt><span class="section"> Class low_watermark</span></dt>
+<dt><span class="section"> Class scanns</span></dt>
+<dt><span class="section"> Class invalid_poolsize</span></dt>
+<dt><span class="section"> Class invalid_scanns</span></dt>
+<dt><span class="section"> Class invalid_timeduration</span></dt>
+<dt><span class="section"> Class invalid_watermark</span></dt>
+<dt><span class="section"> Class task_rejected</span></dt>
+<dt><span class="section"> Class task_unitialized</span></dt>
+<dt><span class="section"> Class task_already_executed</span></dt>
+<dt><span class="section"> Class task_moved</span></dt>
+<dt><span class="section"> Class broken_task</span></dt>
+<dt><span class="section"> Class task_interrupted</span></dt>
+<dt><span class="section"> Class pool_moved</span></dt>
+</dl></dd>
+<dt><span class="section">Appendices</span></dt>
+<dd><dl>
+<dt><span class="section"> Appendix A: Future development</span></dt>
+<dt><span class="section"><a href="boost_task/appendices.html#boost_task.appendices.acknowledgements"> Appendix B:
+ Acknowledgments</a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="section" title="Overview">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_task.overview"></a><a class="link" href="index.html#boost_task.overview" title="Overview"> Overview</a>
+</h2></div></div></div>
+<p>
+ <span class="bold"><strong>Boost.Task</strong></span> provides a framework for parallel
+ execution of tasks (a task is a small unit of code that can be executed independently).
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<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">task</span></code>, a <span class="emphasis"><em>callable</em></span> representing
+ a fine-grained work-item:
+ <div class="itemizedlist"><ul class="itemizedlist" type="circle">
+<li class="listitem">
+<code class="computeroutput"><span class="keyword">operator</span><span class="special">()()</span></code>
+ to execute the fine-grained work-item
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">get_future</span><span class="special">()</span></code>
+ providing an <span class="emphasis"><em>asynchronous-completion-token</em></span> in order
+ to pass the result (values, exceptions) back to initiator
+ </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">handle</span></code>, works as a <span class="emphasis"><em>asynchronous-completion-token</em></span>
+ of executed task:
+ <div class="itemizedlist"><ul class="itemizedlist" type="circle">
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code>,
+ <code class="computeroutput"><span class="identifier">interrupt_and_wait</span><span class="special">()</span></code>,
+ ... allow to cancel an cooperative task
+ </li>
+<li class="listitem">
+ interface of the <span class="emphasis"><em>asynchronous-completion-token</em></span>:
+ <div class="itemizedlist"><ul class="itemizedlist" type="square">
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code>
+ retrieve value or exception of task execution
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">is_ready</span><span class="special">()</span></code>
+ test if task was executed
+ </li>
+<li class="listitem">
+<code class="computeroutput"><span class="identifier">wait</span><span class="special">()</span></code>,
+ <code class="computeroutput"><span class="identifier">wait_for</span><span class="special">()</span></code>
+ and <code class="computeroutput"><span class="identifier">wait_until</span><span class="special">()</span></code>
+ block until task is executed and the result is set
+ </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 <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_future</span></code>
+</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 by means of <span class="emphasis"><em>execution-policies</em></span>
+</li>
+<li class="listitem">
+<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
+ thread
+ </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">new_thread</span></code>: executes task in a newly-created
+ thread (thread will be destroyed after completion)
+ </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">as_sub_task</span></code>: executes task in newly-created
+ thread or in a pool of <span class="emphasis"><em>worker-threads</em></span> depending
+ on whether the parent-task is already executed in a <span class="emphasis"><em>thread-pool</em></span>
+</li>
+<li class="listitem">
+<span class="emphasis"><em>thread-pool</em></span>: task gets executed by a <span class="emphasis"><em>worker-thread</em></span>
+ of a custom <span class="emphasis"><em>thread-pool</em></span> (for instance with priority
+ or smart scheduling)
+ </li>
+</ul></div>
+</li>
+<li class="listitem">
+<span class="emphasis"><em>thread-pools</em></span> with work-stealing algorithm and for/join
+ semantics
+ </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">
+ detects if parent-task runs in a <span class="emphasis"><em>thread-pool</em></span> - the
+ appropriate mechanism for executing the sub-tasks is choosen
+ </li>
+</ul></div>
+</li>
+</ul></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>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</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="id638414"></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">&lt;=</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="comment">// create a thread-pool
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">static_pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">::</span><span class="identifier">fifo</span>
+ <span class="special">&gt;</span>
+ <span class="special">&gt;</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="comment">// create two tasks, computing fibonacci numbers
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t1</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="identifier">boost</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</span> <span class="identifier">t2</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="comment">// execute tasks in thread-pool
+</span> <span class="comment">// move tasks ownership to executor
+</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">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t1</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">handle</span><span class="special">&lt;</span> <span class="keyword">long</span> <span class="special">&gt;</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">move</span><span class="special">(</span> <span class="identifier">t2</span><span class="special">),</span>
+ <span class="identifier">pool</span><span class="special">);</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"h1: is ready == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"h2: is ready == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span><span class="special">;</span>
+
+ <span class="comment">// wait for completion of both tasks
+</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">&lt;&lt;</span> <span class="string">"h1: is ready == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"h2: is ready == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">is_ready</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"h1: has value == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">has_value</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"h2: has value == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">has_value</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"h1: has exception == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">has_exception</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"h2: has exception == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">boolalpha</span> <span class="special">&lt;&lt;</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">has_exception</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span><span class="special">;</span>
+
+ <span class="comment">// get results
+</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"fibonacci(10) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="string">"fibonacci(5) == "</span> <span class="special">&lt;&lt;</span> <span class="identifier">h2</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">&lt;&lt;</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="id640113"></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
+ written by Peter Dimov.
+ </li>
+<li class="listitem">
+ N2276: Thread Pools and Futures http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2276.html
+ written by Anthony Williams.
+ </li>
+<li class="listitem">
+ 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.
+ </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">
+'Sutter’s Mill' by
+ Herb Sutter
+ </li>
+<li class="listitem">
+ mailing list of C++ standard committee's Library Working Group
+ </li>
+</ul></div>
+<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>
+ <span class="bold"><strong>Boost.Task</strong></span> uses Boost.Future from Anthony Williams (will be
+ integrated in some of the next releases of Boost.Thread).
+ </p></td></tr>
+</table></div>
+<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>
+ Please note that <span class="bold"><strong>Boost.Task</strong></span> is not optimized
+ yet.
+ </p></td></tr>
+</table></div>
+<a name="boost_task.overview.tested_platforms"></a><h4>
+<a name="id640225"></a>
+ <a class="link" href="index.html#boost_task.overview.tested_platforms">Tested Platforms</a>
+ </h4>
+<p>
+ <span class="bold"><strong>Boost.Task</strong></span> has been tested on the following
+ platforms and compilers:
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ Debian GNU/Linux 2.6.29.2 (x86_64), GCC 4.3.3
+ </li>
+<li class="listitem">
+ Ubuntu GNU/Linux 2.6.28.11 (x86), GCC 4.3.3
+ </li>
+<li class="listitem">
+ FreeBSD 7.2 (x86), GCC 4.2.1
+ </li>
+<li class="listitem">
+ OpenSolaris 2009.06 (x86_64), GCC 4.3.2
+ </li>
+<li class="listitem">
+ Windows XP Professional (x86), MSVC 9.0
+ </li>
+</ul></div>
+<a name="boost_task.overview.how_to_build_and_install"></a><h4>
+<a name="id640269"></a>
+ <a class="link" href="index.html#boost_task.overview.how_to_build_and_install">How to build and
+ install</a>
+ </h4>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+ download the sources form <a href="http://www.boost-consulting.com/vault/index.php?directory=Concurrent%20Programming" target="_top">Boost
+ Vault</a> or the latest development version from boost-sandbox
+</li>
+<li class="listitem">
+ extract the archive into the boost-source directory
+ </li>
+<li class="listitem">
+ call <span class="emphasis"><em>'bjam toolset=&lt;compiler-name&gt; --with-task install'</em></span>
+ in order to build and install <span class="bold"><strong>Boost.Task</strong></span>
+</li>
+</ul></div>
+</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 23, 2009 at 18:15:43 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="boost_task/motivation.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
+</body>
+</html>

Added: sandbox/task/libs/task/doc/html/minimal.css
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/minimal.css 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,29 @@
+/*
+
+ © Copyright Beman Dawes, 2007
+
+ Distributed under the Boost Software License, Version 1.0.
+ See www.boost.org/LICENSE_1_0.txt
+
+*/
+
+/*******************************************************************************
+ Body
+*******************************************************************************/
+
+body { font-family: sans-serif; margin: 1em; }
+
+/*******************************************************************************
+ Table
+*******************************************************************************/
+
+table { margin: 0.5em; }
+
+/*******************************************************************************
+ Font sizes
+*******************************************************************************/
+
+p, td, li, blockquote { font-size: 10pt; }
+pre { font-size: 9pt; }
+
+/*** end ***/
\ No newline at end of file

Added: sandbox/task/libs/task/doc/html/reference.css
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/html/reference.css 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -0,0 +1,11 @@
+/*============================================================================
+ Copyright 2003-2004 Douglas Gregor
+ Distributed under the Boost Software License, Version 1.0. (See accompany-
+ ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+============================================================================*/
+
+PRE.synopsis {
+ background-color: #e0ffff;
+ border: thin solid blue;
+ padding: 1em
+}
\ No newline at end of file

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -35,9 +35,11 @@
                 // task, to be executed asynchronously
                 boost::task::task< void > t( print, "Hello World!");
 
- boost::task::async( // dispatchs task,
- boost::move( t), // move task ownership to executor
- boost::task::new_thread() ) ); // execution-policy
+ // execute task in newly-created thread
+ // move task ownership to executor
+ boost::task::async(
+ boost::move( t),
+ boost::task::new_thread() ) );
         }
 ``
 
@@ -53,12 +55,15 @@
                 // task returning the submitted string
                 boost::task::task< std::string > t( echo, "Hello World!");
 
+ // execute task in newly-created thread
+ // move task ownership to executor
                 boost::task::handle< std::string > h(
                         boost::task::async(
- boost::move( t), // move task ownership to executor
- boost::task::new_thread() ) ); // execute task in a new thread
+ boost::move( t),
+ boost::task::new_thread() ) );
 
- std::cout << h.get() << std::endl; // wait until task is finished and return the result
+ // wait until task has finished and return the result
+ std::cout << h.get() << std::endl;
         }
 ``
 
@@ -70,17 +75,23 @@
 
         void main()
         {
- // long runing task
+ // create a long runing task
                 boost::task::task< void > t( long_running, boost::posix_time::millisec( 500) );
 
+ // execute task in newly-created thread
+ // move task ownership to executor
                 boost::task::handle< std::string > h(
                         boost::task::async(
- boost::move( t), // move task ownership to executor
- boost::task::new_thread() ) ); // execute task in a new thread
-
- h.interrupt(); // interrupt execution of task
+ boost::move( t),
+ boost::task::new_thread() ) );
 
- std::cout << h.get() << std::endl; // wait until task is finished, will throw an task_interrupted exeception
+ // requests interruption of task
+ // returns immediately
+ h.interrupt();
+
+ // access the result
+ // task_interrupted exeception will be thrown
+ std::cout << h.get() << std::endl;
         }
 ``
 
@@ -99,17 +110,18 @@
                 if ( n < cutof) return serial_fib( n);
                 else
                 {
- // fork a sub-task calculating fibonacci(n-1)
+ // create a sub-task calculating fibonacci(n-1)
                         boost::task::task< long > t1(
                                 parallel_fib,
                                 n - 1,
                                 cutof);
- // fork a sub-task calculating fibonacci(n-2)
+ // create a sub-task calculating fibonacci(n-2)
                         boost::task::task< long > t2(
                                 parallel_fib,
                                 n - 2,
                                 cutof);
 
+ // fork two sub-tasks
                         boost::task::handle< long > h1(
                                 boost::task::async(
                                         boost::move( t1),
@@ -126,24 +138,28 @@
 
         void main()
         {
+ // create a thread-pool with five worker-threads
                 boost::task::static_pool<
                         boost::task::unbounded_channel<
                                 boost::task::fifo
>
> pool( boost::task::poolsize( 5) );
 
- // task calculates fibonacci-number for 10
+ // create task computing fibonacci-number for 10
                 boost::task::task< long > t(
                         parallel_fib,
                         10,
                         5);
 
+ // execute task in a thread-pool
+ // move task ownership to executor
                 boost::task::handle< long > h(
                         boost::task::async(
- boost::move( t), // move task ownership to thread-pool
- boost::task::default_pool() ) ); // execution-policy == thread-pool
+ boost::move( t),
+ pool) );
 
- std::cout << h.get() << std::endl;
+ // access the result
+ std::cout << "fibonacci(10) == " << h.get() << std::endl;
         }
 ``
 
@@ -153,14 +169,17 @@
 [link_work_stealing __work_stealing__] and [link_forkjoin inline execution] of tasks.
 
 ``
+ // create a long runing task
         boost::task::task< long > t(
                 parallel_fib,
                 10,
                 5);
 
+ // move task ownership to executor
+ // sub-task executed in a new thread or inside the thread-pool
         boost::task::async(
                 boost::move( t),
- boost::task::as_sub_task() ); // sub-task executed in a new thread or inside a thread-pool
+ boost::task::as_sub_task() );
 ``
 
 

Modified: sandbox/task/libs/task/doc/meta_functions.qbk
==============================================================================
--- sandbox/task/libs/task/doc/meta_functions.qbk (original)
+++ sandbox/task/libs/task/doc/meta_functions.qbk 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -13,12 +13,18 @@
 
 
 ``
+ // thread-pool with priority scheduling
+ // type of priority is int
         typdef boost::task::static_pool<
                 boost::task::unbounded_channel<
- boost::task::priority< int > > // pool with priority scheduling; integer as priority type
+ boost::task::priority< int >
+ >
> pool_type;
 
+ // test if thread-pool supports priorities at compile time
         std::cout << std::boolalpha << boost::task::has_attribute< pool_type >::value << "\n";
+
+ // access the type used for priority
         std::cout << typeid( boost::task::attribute_type< pool_type >::type).name() << std::endl;
 ``
 

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -47,13 +47,15 @@
 reference gets out of scope). ]
 
 
-In the example below both `a_function()` and `another_function()` are executed synchron because the returned __handle__ joins the
-the __worker_thread__!
+In the example below both `a_function()` and `another_function()` are executed synchron because the returned __handle__ is not stored in
+a variable. Thatswhy the __worker_thread__ is joined after return from __fn_async__!
 
 ``
         boost::task::task< void > t1( a_function);
         boost::task::task< void > t2( another_function);
 
+ // handles are not retrieved
+ // both task executed in sequence
         boost::task::async(
                 boost::move( t1),
                 boost::task::new_thread() ) );

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -8,9 +8,9 @@
 
 [section:overview Overview]
 
-__boost_task__ provides an framework for parallel execution of tasks (a task is a small unit of code that can be executed independently).
+__boost_task__ provides a framework for parallel execution of tasks (a task is a small unit of code that can be executed independently).
 
-* __task__, __callable__ representing a fine-grained work-item:
+* __task__, a __callable__ representing a fine-grained work-item:
         * __fn_operator__ to execute the fine-grained work-item
         * __fn_get_future__ providing an __act__ in order to pass the result (values, exceptions) back to initiator
 
@@ -23,12 +23,12 @@
         * __fn_get_future__ returns reference to internal __shared_future__
         * functions __waitfor_all__/__waitfor_any__ to wait for all or any handles
 
-* __fn_async__, executes a task on behalf of __eps__
+* __fn_async__, executes a task by means of __eps__
 
 * __ep__ models:
- * __own_thread__: executes task in current thread.
- * __new_thread__: executes task in a newly created thread (thread will be destroyed after)
- * __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 __thread_pool__
+ * __own_thread__: executes task in current thread
+ * __new_thread__: executes task in a newly-created thread (thread will be destroyed after completion)
+ * __as_sub_task__: executes task in newly-created thread or in a pool of __worker_threads__ depending on whether the parent-task is already executed in a __thread_pool__
         * __thread_pool__: task gets executed by a __worker_thread__ of a custom __thread_pool__ (for instance with priority or smart scheduling)
 
 * __thread_pools__ with work-stealing algorithm and for/join semantics
@@ -36,7 +36,7 @@
 * support of forking and joining sub-tasks
         * better performance
         * no deadlock because of inline-execution of sub-tasks
- * automatically detects if code runs in a __thread_pool__ so the appropriate mechanism for executing the sub-tasks is choosen
+ * detects if parent-task runs in a __thread_pool__ - the appropriate mechanism for executing the sub-tasks is choosen
 
 
 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,
@@ -75,17 +75,27 @@
 
         void main()
         {
- // create two tasks for calculating fibonacci numbers
+ // create a thread-pool
+ boost::task::static_pool<
+ boost::task::unbounded_channel<
+ boost::task::fifo
+ >
+ > pool( boost::task::poolsize( 5) );
+
+ // create two tasks, computing fibonacci numbers
                 boost::task< long > t1( fibonacci, 10);
                 boost::task< long > t2( fibonacci, 5);
 
+ // execute tasks in thread-pool
                 // move tasks ownership to executor
                 boost::task::handle< long > h1(
                         boost::task::async(
- boost::move( t1), tsk::new_thread() );
+ boost::move( t1),
+ pool);
                 boost::task::handle< long > h2(
                         boost::task::async(
- boost::move( t2), tsk::new_thread() );
+ boost::move( t2),
+ pool);
 
                 std::cout << "h1: is ready == " << std::boolalpha << h1.is_ready() << "\n";
                 std::cout << "h2: is ready == " << std::boolalpha << h2.is_ready() << "\n";
@@ -139,8 +149,8 @@
 
 [heading How to build and install]
 
-* 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]
+* download the sources form [@http://www.boost-consulting.com/vault/index.php?directory=Concurrent%20Programming Boost Vault] or the latest
+development version from [@https://svn.boost.org/svn/boost/sandbox/task/ boost-sandbox]
 * extract the archive into the boost-source directory
 * call [''bjam toolset=<compiler-name> --with-task install'] in order to build and install __boost_task__
 

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -23,19 +23,27 @@
 
         void main()
         {
+ // create a thread-pool with
+ // five worker-threads
+ // FIFO schduling of queued tasks
+ // and unlimited size of internal queue
                 boost::task::static_pool<
                         boost::task::unbounded_channel<
                                 boost::task::fifo
>
> pool( boost::task::poolsize( 5) );
 
+ // create task
                 boost::task::task< std::string > t( echo, "Hello World!");
 
+ // move task to executor
+ // let the task be executed by the thread-pool
                 boost::task::handle< std::string > h(
                         boost::task::async(
                                 boost::move( t),
                                 pool) );
 
+ // access the result
                 std::cout << h.get() << std::endl;
         }
 ``

Modified: sandbox/task/libs/task/doc/processor_binding.qbk
==============================================================================
--- sandbox/task/libs/task/doc/processor_binding.qbk (original)
+++ sandbox/task/libs/task/doc/processor_binding.qbk 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -12,11 +12,12 @@
 be given to constructor instead __pool_size__ so that a __worker_thread__ is created an bound the the core.
 
 ``
- // constructs thread-pool with worker-threads as hardware_concurrency() returns
         typedef boost::task::static_pool<
                 boost::task::unbounded_channel< boost::tp::fifo >
> pool_type;
 
+ // constructs thread-pool with worker-threads as
+ // CPUs/Cores are available on the system
         pool_type pool( pool_type::bind_to_processors() );
 ``
 

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -76,7 +76,7 @@
                 template< typename R, typename Attr >
                 handle< R > submit( task< R > && t, Attr const& attr);
 
- void swap( static_pool & other); // throw()
+ void swap( static_pool & other);
 
                 operator unspecified_bool_type() const;
                 bool operator!() const;

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -21,22 +21,28 @@
 Each __task__ is submitted to the pool with a priority attribute. The type and ordering of the priority is user-defined.
 
 ``
+ // thread-pool with priority scheduling
+ // tasks with higher priority are
+ // scheduled first
         boost::task::static_pool<
- boost::task::unbounded_channel< // allow unlimited tasks to be queue in global-queue
- boost::task::priority< int > > // tasks with lower priority are scheduled first
+ boost::task::unbounded_channel<
+ boost::task::priority< int > >
> pool( boost::task::poolsize( 5) );
 
- boost::task::task< void > t1( some_fn); // task to be executed
- boost::task::task< void > t2( another_fn); // task to be executed
+ boost::task::task< void > t1( some_fn);
+ boost::task::task< void > t2( another_fn);
 
+ // move task t1 with priority 5 to thread-pool
         boost::task::async(
                 boost::move( t1),
- 5, // priority is 5
- pool); // thread-pool
+ 5,
+ pool);
+
+ // move task t2 with priority 3 to thread-pool
         boost::task::async(
- boost::move( t2), // task to be executed
- 3, // priority is 3
- pool); // thread-pool
+ boost::move( t2),
+ 3,
+ pool);
 ``
 
 In this example the tasks get scheduled by the assigned integer (third argument of __fn_async__). The __task__ with the
@@ -44,10 +50,13 @@
 of __priority__ (the default is `std::greater< Attr >`).
 
 ``
+ // thread-pool with priority scheduling
+ // tasks with lower priority are
+ // scheduled first
         boost::task::static_pool<
                 boost::task::unbounded_channel<
- boost::task::priority< int > > // tasks with higher priority are scheduled first
-
+ boost::task::priority< int, std::less< int > >
+ >
> pool( boost::task::poolsize( 5) );
 ``
 

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -57,7 +57,8 @@
                                 boost::move( t2),
                                 pool) );
 
- pool.shutdown(); // waits until all pending tasks are finished
+ // waits until all pending tasks are finished
+ pool.shutdown();
 
                 std::cout << "fibonacci(10) == " << h1.get() << "\n";
                 std::cout << "fibonacci(5) == " << h2.get() << std::endl;
@@ -111,10 +112,13 @@
                                 boost::move( t2),
                                 pool) );
 
+ // requests task interruption and
+ // joins all worker-threads
                 pool.shutdown_now();
 
- std::cout << "fibonacci(10) == " << h1.get() << "\n"; // may throw broken_task or task_interrupted
- std::cout << "fibonacci(5) == " << h2.get() << std::endl; // may throw broken_task or task_interrupted
+ // accessing the result may throw task_interrupted
+ std::cout << "fibonacci(10) == " << h1.get() << "\n";
+ std::cout << "fibonacci(5) == " << h2.get() << std::endl;
         }
 ``
 

Modified: sandbox/task/libs/task/doc/static_pool.qbk
==============================================================================
--- sandbox/task/libs/task/doc/static_pool.qbk (original)
+++ sandbox/task/libs/task/doc/static_pool.qbk 2009-06-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -13,14 +13,14 @@
 
 
 ``
- boost::task::_static_pool< // pool type
- boost::task::unbounded_channel< // queuing policy (unbounded_channel, bounded_channel)
- boost::task::fifo // scheduling policy (fifo, priority, smart)
- >
- > pool(
- boost::task::poolsize( 6), // pool with 6 pre-forked worker-threads
- boost::posix_time::posix_time::milliseconds( 50), // time to sleep if no work-item available
- boost::task::scanns( 10) ); // iterations over local-queues before sleep
+ boost::task::_static_pool< // pool type
+ boost::task::unbounded_channel< // queuing policy (unbounded_channel, bounded_channel)
+ boost::task::fifo // scheduling policy (fifo, priority, smart)
+ >
+ > pool(
+ boost::task::poolsize( 6), // pool with 6 pre-forked worker-threads
+ boost::posix_time::posix_time::milliseconds( 50), // time to sleep if no work-item available
+ boost::task::scanns( 10) ); // iterations over local-queues before sleep
 ``
 
 

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-23 14:16:55 EDT (Tue, 23 Jun 2009)
@@ -78,14 +78,16 @@
 ``
         long cooperative( long n)
         {
- boost::this_thread::interruption_point(); // interruption point
+ // interruption point
+ boost::this_thread::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
+ // check if interruption was requested
+ if ( boost::this_thread::interruption_requested() )
                                 return;
                                 
                         long tmp( k1);
@@ -93,27 +95,31 @@
                         k2 = tmp;
                 }
                 
- boost::this_thread::interruption_point(); // interruption point
+ // interruption point
+ boost::this_thread::interruption_point();
                 
                 return k1;
         }
 
         void main()
         {
- // task for calculating fibonacci number
+ // task for computing fibonacci-number
                 boost::task::task< long > t( cooperative, 10) );
 
                 // execute task in new thread
+ // move task ownership to executor
                 boost::task::handle< long > h(
                         boost::task::async(
                                 boost::move( t),
                                 boost::task::new_thread() ) );
 
- // interrupt task an wait until it is removed by the worker-thread
+ // interrupt task an wait until
+ // the task is removed by the worker-thread
                 h.interrupt_and_wait();
 
+ // access the result
                 // throws boost::task::task_interrupted
- std::cout << h.get() << std::endl;
+ std::cout << "fibonacci(10) == " << h.get() << std::endl;
         }
 ``
 
@@ -132,15 +138,17 @@
 
         void main()
         {
- // task will throw std::domain_error
+ // create task throwing std::domain_error
                 boost::task::task void > t( throwing);
 
                 // execute task asynchron
+ // move task ownership to executor
                 boost::task::handle< void > h(
                         boost::task::async(
                                 boost::move( t),
                                 boost::task::new_thread() ) );
 
+ // wait for task completion
                 // throws std::domain_error
                 std::cout << h.wait() << std::endl;
         }
@@ -194,54 +202,56 @@
                 if ( n < cutof) return serial_fib( n);
                 else
                 {
- // sub-task for calculating fibonacci(n-1)
+ // sub-task for computing fibonacci(n-1)
                         boost::task::task< long > t1(
                                 parallel_fib,
                                 n - 1,
                                 cutof);
- // sub-task for calculating fibonacci(n-2)
+ // sub-task for computing fibonacci(n-2)
                         boost::task::task< long > t2(
                                 parallel_fib,
                                 n - 2,
                                 cutof);
 
- // submit a sub-task to pool calculating fibonacci(n-1)
+ // submit a sub-tasks to thread-pool
+ // move task ownership to executor
                         boost::task::handle< long > h1(
                                 boost::task::async(
                                         boost::move( t1) );
- // submit a sub-task to pool calculating fibonacci(n-2)
                         boost::task::handle< long > h2(
                                 boost::task::async(
                                         boost::move( t2) );
 
- // calculate fibonacci(n) by joining results of both sub-tasks
+ // computing fibonacci(n) by
+ // joining results of both sub-tasks
                         return h1.get() + h2.get();
                 }
         }
 
         void main()
         {
- // create thread-pool
+ // create thread-pool with five worker-threads
                 boost::task::static_pool<
                         boost::task::unbounded_channel<
                                 boost::task::fifo
>
> pool( boost::task::poolsize( 5) );
 
- // task calculates recursivly fibonacci-numberof 10
+ // create task computing fibonacci-number for 10
                 boost::task::task< long > t(
                         parallel_fib,
                         10,
                         5);
 
                 // execute task asynchron in thread-pool
+ // move task ownership to executor
                 boost::task::handle< long > h(
                         boost::task::async(
                                 boost::move( t),
                                 pool) );
 
- // get result
- std::cout << h.get() << std::endl;
+ // access result
+ std::cout << "fibonacci(10) == " << h.get() << std::endl;
         }
 ``
 


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