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="programlistin