Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51482 - in sandbox/threadpool: boost boost/tp boost/tp/detail libs/tp/doc libs/tp/doc/html libs/tp/doc/html/boost_threadpool libs/tp/examples libs/tp/test
From: oliver.kowalke_at_[hidden]
Date: 2009-02-28 09:38:28


Author: olli
Date: 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
New Revision: 51482
URL: http://svn.boost.org/trac/boost/changeset/51482

Log:
* svn problem

Added:
   sandbox/threadpool/libs/tp/doc/html/
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/acknowledgement.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/channel.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/forkjoin.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/pool.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/reference.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/scheduling.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/task.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/html/boost_threadpool/this_task.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/html/index.html (contents, props changed)
   sandbox/threadpool/libs/tp/doc/this_task_ref.qbk (contents, props changed)
Removed:
   sandbox/threadpool/boost/tp/detail/pool_base.hpp
   sandbox/threadpool/boost/tp/detail/worker_base.hpp
   sandbox/threadpool/libs/tp/doc/reschedule_ref.qbk
Text files modified:
   sandbox/threadpool/boost/future.hpp | 56 +++++++++++++
   sandbox/threadpool/boost/tp/pool.hpp | 84 +++++++++++----------
   sandbox/threadpool/boost/tp/task.hpp | 48 ++++++------
   sandbox/threadpool/libs/tp/doc/forkjoin.qbk | 157 ++++++++++++++++++++++-----------------
   sandbox/threadpool/libs/tp/doc/reference.qbk | 2
   sandbox/threadpool/libs/tp/doc/this_task.qbk | 4
   sandbox/threadpool/libs/tp/doc/threadpool.xml | 154 ++++++++++++++++++++++++++++++++++++---
   sandbox/threadpool/libs/tp/doc/wait_ref.qbk | 32 ++++----
   sandbox/threadpool/libs/tp/examples/fork_join.cpp | 17 +--
   sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp | 17 +--
   sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp | 6
   sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp | 6
   sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp | 6
   sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp | 6
   sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp | 6
   sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp | 6
   sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp | 6
   sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp | 6
   18 files changed, 405 insertions(+), 214 deletions(-)

Modified: sandbox/threadpool/boost/future.hpp
==============================================================================
--- sandbox/threadpool/boost/future.hpp (original)
+++ sandbox/threadpool/boost/future.hpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -7,6 +7,7 @@
 #ifndef N2561_FUTURE_HPP
 #define N2561_FUTURE_HPP
 #include <stdexcept>
+#include <boost/exception.hpp>
 #include <boost/thread.hpp>
 #include <boost/thread/detail/move.hpp>
 #include <boost/thread/thread_time.hpp>
@@ -26,6 +27,10 @@
 #include <list>
 #include <boost/next_prior.hpp>
 
+#define CATCH_ENABLE_CURRENT_EXCEPTION( Exception) \
+catch ( Exception const& e) \
+{ throw boost::enable_current_exception( e); }
+
 namespace jss
 {
     class future_uninitialized:
@@ -1202,7 +1207,28 @@
             {
                 try
                 {
- this->mark_finished_with_result(f());
+ try
+ { this->mark_finished_with_result(f()); }
+ CATCH_ENABLE_CURRENT_EXCEPTION( boost::thread_interrupted)
+ CATCH_ENABLE_CURRENT_EXCEPTION( boost::exception)
+
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::domain_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::invalid_argument)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::length_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::out_of_range)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::logic_error)
+
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::overflow_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::range_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::underflow_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::runtime_error)
+
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::bad_alloc)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::bad_cast)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::bad_typeid)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::bad_exception)
+
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::ios_base::failure)
                 }
                 catch(...)
                 {
@@ -1227,8 +1253,31 @@
             {
                 try
                 {
- f();
- this->mark_finished_with_result();
+ try
+ {
+ f();
+ this->mark_finished_with_result();
+ }
+ CATCH_ENABLE_CURRENT_EXCEPTION( boost::thread_interrupted)
+ CATCH_ENABLE_CURRENT_EXCEPTION( boost::exception)
+
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::domain_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::invalid_argument)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::length_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::out_of_range)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::logic_error)
+
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::overflow_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::range_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::underflow_error)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::runtime_error)
+
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::bad_alloc)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::bad_cast)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::bad_typeid)
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::bad_exception)
+
+ CATCH_ENABLE_CURRENT_EXCEPTION( std::ios_base::failure)
                 }
                 catch(...)
                 {
@@ -1360,5 +1409,6 @@
 
 }
 
+#undef CATCH_ENABLE_CURRENT_EXCEPTION
 
 #endif

Deleted: sandbox/threadpool/boost/tp/detail/pool_base.hpp
==============================================================================
--- sandbox/threadpool/boost/tp/detail/pool_base.hpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
+++ (empty file)
@@ -1,27 +0,0 @@
-// Copyright (c) 2008 Oliver Kowalke. 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)
-
-#ifndef BOOST_TP_DETAIL_POOL_BASE_H
-#define BOOST_TP_DETAIL_POOL_BASE_H
-
-#include <boost/thread/tss.hpp>
-
-#include <boost/tp/detail/worker_base.hpp>
-
-namespace boost { namespace tp {
-namespace detail
-{
-
-struct pool_base
-{
- static thread_specific_ptr< worker_base > tss_worker_;
-};
-
-thread_specific_ptr< worker_base >
-pool_base::tss_worker_;
-
-} } }
-
-#endif // BOOST_TP_DETAIL_POOL_BASE_H
-

Deleted: sandbox/threadpool/boost/tp/detail/worker_base.hpp
==============================================================================
--- sandbox/threadpool/boost/tp/detail/worker_base.hpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
+++ (empty file)
@@ -1,67 +0,0 @@
-// Copyright (c) 2008 Oliver Kowalke. 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)
-
-#ifndef BOOST_TP_DETAIL_WORKER_BASE_H
-#define BOOST_TP_DETAIL_WORKER_BASE_H
-
-#include <cstddef>
-
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/thread.hpp>
-
-#include <boost/tp/detail/callable.hpp>
-#include <boost/tp/detail/interrupter.hpp>
-
-namespace boost { namespace tp {
-namespace detail
-{
-
-struct worker_base
-{
- virtual ~worker_base() {}
-
- virtual const shared_ptr< thread > thrd() const = 0;
-
- virtual const thread::id get_id() const = 0;
-
- virtual void join() const = 0;
-
- virtual void interrupt() const = 0;
-
- virtual void put(
- callable const& ca,
- interrupter const& intr) = 0;
-
- virtual bool try_take(
- callable & ca,
- interrupter & intr) = 0;
-
- virtual bool try_steal(
- callable & ca,
- interrupter & intr) = 0;
-
- virtual bool empty() const = 0;
-
- virtual void signal_shutdown() = 0;
-
- virtual void signal_shutdown_now() = 0;
-
- virtual bool shutdown() = 0;
-
- virtual bool shutdown_now() = 0;
-
- virtual std::size_t scanns() const = 0;
-
- virtual void increment_scanns() = 0;
-
- virtual void reset_scanns() = 0;
-
- virtual void reschedule_until( function< bool() > const&) = 0;
-};
-
-}}}
-
-#endif // BOOST_TP_DETAIL_WORKER_BASE_H
-

Modified: sandbox/threadpool/boost/tp/pool.hpp
==============================================================================
--- sandbox/threadpool/boost/tp/pool.hpp (original)
+++ sandbox/threadpool/boost/tp/pool.hpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -40,8 +40,6 @@
 #ifdef BOOST_BIND_WORKER_TO_PROCESSORS
 #include <boost/tp/detail/bind_processor.hpp>
 #endif
-#include <boost/tp/detail/pool_base.hpp>
-#include <boost/tp/detail/worker_base.hpp>
 #include <boost/tp/detail/wsq.hpp>
 #include <boost/tp/exceptions.hpp>
 #include <boost/tp/poolsize.hpp>
@@ -60,13 +58,27 @@
 }
 
 namespace boost {
+
+namespace this_task
+{
+template< typename Pool >
+Pool & get_thread_pool()
+{
+ typename Pool::worker * w( Pool::tss_worker_.get() );
+ BOOST_ASSERT( w);
+ return w->get_thread_pool();
+}
+}
+
 namespace tp
 {
 template< typename Channel >
-class pool : private noncopyable,
- private detail::pool_base
+class pool : private noncopyable
 {
 private:
+ template< typename Pool >
+ friend Pool & this_task::get_thread_pool();
+
         typedef Channel channel;
         typedef typename channel::item channel_item;
 
@@ -77,7 +89,7 @@
                 terminated_state
         };
 
- class worker : public detail::worker_base
+ class worker
         {
         private:
                 class wimpl : private noncopyable
@@ -176,15 +188,15 @@
 
                         std::size_t scanns() const
                         { return scns_; }
-
+
                         void increment_scanns()
                         { ++scns_; }
-
+
                         void reset_scanns()
                         { scns_ = 0; }
 
- void reschedule_until( function< bool() > const& cond)
- { pool_ptr_->reschedule_until_( cond); }
+ pool & get_thread_pool()
+ { return * pool_ptr_; }
                 };
 
                 shared_ptr< wimpl > impl_;
@@ -247,8 +259,8 @@
                 void reset_scanns()
                 { impl_->reset_scanns(); }
 
- void reschedule_until( function< bool() > const& cond)
- { impl_->reschedule_until( cond); }
+ pool & get_thread_pool()
+ { return impl_->get_thread_pool(); }
         };
 
         struct id_idx_tag {};
@@ -293,6 +305,7 @@
                 { return die_(); }
         };
 
+ static thread_specific_ptr< worker > tss_worker_;
         static thread_specific_ptr< random_idx > tss_rnd_idx_;
 
         worker_list worker_;
@@ -324,10 +337,10 @@
                 BOOST_ASSERT( ca.empty() );
         }
 
- void next_callable_( detail::worker_base * w, detail::callable & ca, detail::interrupter & intr)
+ void next_callable_( worker & w, detail::callable & ca, detail::interrupter & intr)
         {
                 rnd_idx & ridx( worker_.get< rnd_idx_tag >() );
- if ( ! w->try_take( ca, intr) )
+ if ( ! w.try_take( ca, intr) )
                 {
                         if ( ! channel_.try_take( ca, intr) )
                         {
@@ -344,14 +357,14 @@
                                 {
                                         detail::guard grd( idle_worker_);
                                         if ( shutdown_( w) ) return;
- w->increment_scanns();
- if ( w->scanns() >= scns_)
+ w.increment_scanns();
+ if ( w.scanns() >= scns_)
                                         {
                                                 if ( size_() == idle_worker_)
                                                         channel_.take( ca, intr, asleep_);
                                                 else
                                                         this_thread::sleep( asleep_);
- w->reset_scanns();
+ w.reset_scanns();
                                         }
                                         else
                                                 this_thread::yield();
@@ -362,7 +375,7 @@
 
         void reschedule_until_( function< bool() > const& cond)
         {
- detail::worker_base * w( pool_base::tss_worker_.get() );
+ worker * w( tss_worker_.get() );
                 BOOST_ASSERT( w);
                 shared_ptr< thread > thrd( w->thrd() );
                 BOOST_ASSERT( thrd);
@@ -370,7 +383,7 @@
                 detail::callable ca;
                 while ( ! cond() )
                 {
- next_callable_( w, ca, intr);
+ next_callable_( * w, ca, intr);
                         if( ! ca.empty() )
                         {
                                 execute_( ca, intr, thrd);
@@ -389,7 +402,7 @@
 
                 worker w( * i);
                 BOOST_ASSERT( w.get_id() == this_thread::get_id() );
- pool_base::tss_worker_.reset( new worker( w) );
+ tss_worker_.reset( new worker( w) );
                 shared_ptr< thread > thrd( w.thrd() );
                 BOOST_ASSERT( thrd);
                 detail::callable ca;
@@ -399,9 +412,9 @@
 
                 detail::guard grd( running_worker_);
 
- while ( ! shutdown_( & w) )
+ while ( ! shutdown_( w) )
                 {
- next_callable_( & w, ca, intr);
+ next_callable_( w, ca, intr);
                         if( ! ca.empty() )
                         {
                                 execute_( ca, intr, thrd);
@@ -457,11 +470,11 @@
         bool terminateing_() const
         { return state_ == terminateing_state; }
 
- bool shutdown_( detail::worker_base * w)
+ bool shutdown_( worker & w)
         {
- if ( w->shutdown() && channel_.empty() )
+ if ( w.shutdown() && channel_.empty() )
                         return true;
- else if ( w->shutdown_now() )
+ else if ( w.shutdown_now() )
                         return true;
                 return false;
         }
@@ -685,7 +698,7 @@
                 detail::interrupter intr;
                 jss::packaged_task< R > tsk( act);
                 jss::shared_future< R > fut( tsk.get_future() );
- detail::worker_base * w( pool_base::tss_worker_.get() );
+ worker * w( tss_worker_.get() );
                 if ( w)
                 {
                         function< bool() > cond(
@@ -726,7 +739,7 @@
                 detail::interrupter intr;
                 jss::packaged_task< R > tsk( act);
                 jss::shared_future< R > fut( tsk.get_future() );
- detail::worker_base * w( pool_base::tss_worker_.get() );
+ worker * w( tss_worker_.get() );
                 if ( w)
                 {
                         function< bool() > cond(
@@ -757,23 +770,14 @@
 };
 
 template< typename Channel >
+thread_specific_ptr< typename pool< Channel >::worker >
+pool< Channel >::tss_worker_;
+
+template< typename Channel >
 thread_specific_ptr< typename pool< Channel >::random_idx >
 pool< Channel >::tss_rnd_idx_;
 
-}
-
-namespace this_task
-{
- inline
- void reschedule_until( function< bool() > const& cond)
- {
- tp::detail::worker_base * w( tp::detail::pool_base::tss_worker_.get() );
- BOOST_ASSERT ( w);
- w->reschedule_until( cond);
- }
-}
-
-}
+}}
 
 #endif // BOOST_TP_POOL_H
 

Modified: sandbox/threadpool/boost/tp/task.hpp
==============================================================================
--- sandbox/threadpool/boost/tp/task.hpp (original)
+++ sandbox/threadpool/boost/tp/task.hpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -20,20 +20,20 @@
                 typename T1,
                 typename T2
>
- friend void wait_for_any( T1 &, T2 &);
+ friend void wait_for_any( task< T1 > &, task< T2 > &);
         template<
                 typename T1,
                 typename T2,
                 typename T3
>
- friend void wait_for_any( T1 &, T2 &, T3 &);
+ friend void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &);
         template<
                 typename T1,
                 typename T2,
                 typename T3,
                 typename T4
>
- friend void wait_for_any( T1 &, T2 &, T3 &, T4 &);
+ friend void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &);
         template<
                 typename T1,
                 typename T2,
@@ -41,25 +41,25 @@
                 typename T4,
                 typename T5
>
- friend void wait_for_any( T1 &, T2 &, T3 &, T4 &, T5 &);
+ friend void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &, task< T5 > &);
         template<
                 typename T1,
                 typename T2
>
- friend void wait_for_all( T1 &, T2 &);
+ friend void wait_for_all( task< T1 > &, task< T2 > &);
         template<
                 typename T1,
                 typename T2,
                 typename T3
>
- friend void wait_for_all( T1 &, T2 &, T3 &);
+ friend void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &);
         template<
                 typename T1,
                 typename T2,
                 typename T3,
                 typename T4
>
- friend void wait_for_all( T1 &, T2 &, T3 &, T4 &);
+ friend void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &);
         template<
                 typename T1,
                 typename T2,
@@ -67,7 +67,7 @@
                 typename T4,
                 typename T5
>
- friend void wait_for_all( T1 &, T2 &, T3 &, T4 &, T5 &);
+ friend void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &, task< T5 > &);
         
         jss::shared_future< R > fut_;
         detail::interrupter intr_;
@@ -128,20 +128,20 @@
                 typename T1,
                 typename T2
>
- friend void wait_for_any( T1 &, T2 &);
+ friend void wait_for_any( task< T1 > &, task< T2 > &);
         template<
                 typename T1,
                 typename T2,
                 typename T3
>
- friend void wait_for_any( T1 &, T2 &, T3 &);
+ friend void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &);
         template<
                 typename T1,
                 typename T2,
                 typename T3,
                 typename T4
>
- friend void wait_for_any( T1 &, T2 &, T3 &, T4 &);
+ friend void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &);
         template<
                 typename T1,
                 typename T2,
@@ -149,25 +149,25 @@
                 typename T4,
                 typename T5
>
- friend void wait_for_any( T1 &, T2 &, T3 &, T4 &, T5 &);
+ friend void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &, task< T5 > &);
         template<
                 typename T1,
                 typename T2
>
- friend void wait_for_all( T1 &, T2 &);
+ friend void wait_for_all( task< T1 > &, task< T2 > &);
         template<
                 typename T1,
                 typename T2,
                 typename T3
>
- friend void wait_for_all( T1 &, T2 &, T3 &);
+ friend void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &);
         template<
                 typename T1,
                 typename T2,
                 typename T3,
                 typename T4
>
- friend void wait_for_all( T1 &, T2 &, T3 &, T4 &);
+ friend void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &);
         template<
                 typename T1,
                 typename T2,
@@ -175,7 +175,7 @@
                 typename T4,
                 typename T5
>
- friend void wait_for_all( T1 &, T2 &, T3 &, T4 &, T5 &);
+ friend void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &, task< T5 > &);
         
         jss::shared_future< void > fut_;
         detail::interrupter intr_;
@@ -232,7 +232,7 @@
         typename T1,
         typename T2
>
-void wait_for_all( T1 & t1, T2 & t2)
+void wait_for_all( task< T1 > & t1, task< T2 > & t2)
 { jss::wait_for_all( t1.fut_, t2.fut_); };
 
 template<
@@ -240,7 +240,7 @@
         typename T2,
         typename T3
>
-void wait_for_all( T1 & t1, T2 & t2, T3 & t3)
+void wait_for_all( task< T1 > & t1, task< T2 > & t2, task< T3 > & t3)
 { jss::wait_for_all( t1.fut_, t2.fut_, t3.fut_); };
 
 template<
@@ -249,7 +249,7 @@
         typename T3,
         typename T4
>
-void wait_for_all( T1 & t1, T2 & t2, T3 & t3, T4 & t4)
+void wait_for_all( task< T1 > & t1, task< T2 > & t2, task< T3 > & t3, task< T4 > & t4)
 { jss::wait_for_all( t1.fut_, t2.fut_, t3.fut_, t4.fut_); };
 
 template<
@@ -259,14 +259,14 @@
         typename T4,
         typename T5
>
-void wait_for_all( T1 & t1, T2 & t2, T3 & t3, T4 & t4, T5 & t5)
+void wait_for_all( task< T1 > & t1, task< T2 > & t2, task< T3 > & t3, task< T4 > & t4, task< T5 > & t5)
 { jss::wait_for_all( t1.fut_, t2.fut_, t3.fut_, t4.fut_, t5.fut_); };
 
 template<
         typename T1,
         typename T2
>
-void wait_for_any( T1 & t1, T2 & t2)
+void wait_for_any( task< T1 > & t1, task< T2 > & t2)
 { jss::wait_for_any( t1.fut_, t2.fut_); };
 
 template<
@@ -274,7 +274,7 @@
         typename T2,
         typename T3
>
-void wait_for_any( T1 & t1, T2 & t2, T3 & t3)
+void wait_for_any( task< T1 > & t1, task< T2 > & t2, task< T3 > & t3)
 { jss::wait_for_any( t1.fut_, t2.fut_, t3.fut_); };
 
 template<
@@ -283,7 +283,7 @@
         typename T3,
         typename T4
>
-void wait_for_any( T1 & t1, T2 & t2, T3 & t3, T4 & t4)
+void wait_for_any( task< T1 > & t1, task< T2 > & t2, task< T3 > & t3, task< T4 > & t4)
 { jss::wait_for_any( t1.fut_, t2.fut_, t3.fut_, t4.fut_); };
 
 template<
@@ -293,7 +293,7 @@
         typename T4,
         typename T5
>
-void wait_for_any( T1 & t1, T2 & t2, T3 & t3, T4 & t4, T5 & t5)
+void wait_for_any( task< T1 > & t1, task< T2 > & t2, task< T3 > & t3, task< T4 > & t4, task< T5 > & t5)
 { jss::wait_for_any( t1.fut_, t2.fut_, t3.fut_, t4.fut_, t5.fut_); };
 } }
 

Modified: sandbox/threadpool/libs/tp/doc/forkjoin.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/forkjoin.qbk (original)
+++ sandbox/threadpool/libs/tp/doc/forkjoin.qbk 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -11,73 +11,92 @@
 The fork operation creates a new __sub_action__ (which can run in parallel) in the pool. The current __actions__ is not proceeded in the join operation until the forked __sub_actions__ have completed. In the meantime the __worker_thread__ executes other __actions__ from its local __worker_queue__.
 
     // defines the threadpool type
- typedef boost::tp::pool<
- boost::tp::unbounded_channel< boost::tp::fifo >
- > pool_type;
-
- class fibo
- {
- private:
- pool_type & pool_;
- int cutoff_;
-
- int seq_( int n)
- {
- if ( n <= 1) return n;
- else return seq_( n - 2) + seq_( n - 1);
- }
-
- int par_( int n)
- {
- if ( n <= cutoff_) return seq_( n);
- else
- {
- // fork a new sub-action t1 in pool
- boost::tp::task< int > t1(
- pool_.submit(
- boost::bind(
- & fibo::par_,
- boost::ref( * this),
- n - 1) ) );
-
- // fork a new sub-action t2 in pool
- boost::tp::task< int > t1(
- pool_.submit(
- boost::bind(
- & fibo::par_,
- boost::ref( * this),
- n - 2) ) );
-
- // joining the result of sub-action t1 and t2
- return t1.get() + t2.get();
- }
- }
- public:
- fibo( pool_type & pool, int cutoff)
- : pool_( pool), cutoff_( cutoff)
- {}
-
- int execute( int n)
- {
- int result( par_( n) );
- return result;
- }
- };
-
- // creates a threadpool with two worker-threads
- pool_type pool( boost::tp::poolsize( 2) );
-
- fibo fib( pool, 1);
-
- // submit an action
- // which calculates the fibonacci number of 10
- boost::tp::task< int > t(
- pool.submit(
- boost::bind(
- & fibo::execute,
- boost::ref( fib),
- 10) ) );
-
- std::cout << t.get() << std::endl; // prints 55
-
+ namespace pt = boost::posix_time;
+ namespace tp = boost::tp;
+
+ typedef tp::pool< tp::unbounded_channel< tp::fifo > > pool_type;
+
+ class fibo
+ {
+ private:
+ int offset_;
+
+ int seq_( int n)
+ {
+ if ( n <= 1) return n;
+ else return seq_( n - 2) + seq_( n - 1);
+ }
+
+ int par_( int n)
+ {
+ if ( n <= offset_) return seq_( n);
+ else
+ {
+ tp::task< int > t1(
+ boost::this_task::get_thread_pool< pool_type >().submit(
+ boost::bind(
+ & fibo::par_,
+ boost::ref( * this),
+ n - 1) ) );
+ tp::task< int > t2(
+ boost::this_task::get_thread_pool< pool_type >().submit(
+ boost::bind(
+ & fibo::par_,
+ boost::ref( * this),
+ n - 2) ) );
+ return t1.get() + t2.get();
+ }
+ }
+
+ public:
+ fibo( int offset)
+ : offset_( offset)
+ {}
+
+ int execute( int n)
+ {
+ int result( par_( n) );
+ return result;
+ }
+ };
+
+ int main( int argc, char *argv[])
+ {
+ try
+ {
+ pool_type pool( tp::poolsize( 3) );
+ fibo fib( 5);
+ std::vector< tp::task< int > > results;
+ results.reserve( 40);
+
+ pt::ptime start( pt::microsec_clock::universal_time() );
+
+ for ( int i = 0; i < 32; ++i)
+ results.push_back(
+ pool.submit(
+ boost::bind(
+ & fibo::execute,
+ boost::ref( fib),
+ i) ) );
+
+ int k = 0;
+ std::vector< tp::task< int > >::iterator e( results.end() );
+ for (
+ std::vector< tp::task< int > >::iterator i( results.begin() );
+ i != e;
+ ++i)
+ std::cout << "fibonacci " << k++ << " == " << i->get() << std::endl;
+
+ pt::ptime stop( pt::microsec_clock::universal_time() );
+ std::cout << ( stop - start).total_milliseconds() << " milli seconds" << std::endl;
+
+ return EXIT_SUCCESS;
+ }
+ catch ( std::exception const& e)
+ { std::cerr << "exception: " << e.what() << std::endl; }
+ catch ( ... )
+ { std::cerr << "unhandled" << std::endl; }
+
+ return EXIT_FAILURE;
+ }
 [endsect]

Added: sandbox/threadpool/libs/tp/doc/html/boost_threadpool/acknowledgement.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/boost_threadpool/acknowledgement.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Acknowledgements</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="prev" href="forkjoin.html" title="Fork/Join">
+<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="forkjoin.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" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.acknowledgement"></a><a class="link" href="acknowledgement.html" title="Acknowledgements"> Acknowledgements</a>
+</h2></div></div></div>
+<p>
+ I'd like to thank Vincente Botet for his comments on the implementation details
+ of the code and Anthony Williams and Braddock Gaskill for their future libraries.
+ </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 © 2008 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="forkjoin.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/threadpool/libs/tp/doc/html/boost_threadpool/channel.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/boost_threadpool/channel.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,79 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Channel</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="prev" href="this_task.html" title="Namespace this_task">
+<link rel="next" href="scheduling.html" title="Scheduling">
+</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="this_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="scheduling.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.channel"></a><a class="link" href="channel.html" title="Channel"> Channel</a>
+</h2></div></div></div>
+<p>
+ The channel synchronizes the access between application threads (producer threads)
+ submitting actions to the pool and worker threads (consumer threads). The scheduling
+ of actions queued into the channel depends on channels the scheduling policy.
+ If the channel becomes empty all worker threads are set to sleep until a new
+ action is put in.
+ </p>
+<a name="boost_threadpool.channel.bounded_channel"></a><h4>
+<a name="id372089"></a>
+ <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel">bounded channel</a>
+ </h4>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">SchedulingPolicy</span> <span class="special">&gt;</span> <span class="keyword">class</span> <span class="identifier">bounded_channel</span>
+</pre>
+<p>
+ The number of pending actions 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">tp</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 tasks will be set to sleep (blocked). <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">low_watermark</span></code> sets the threshold when blocked
+ threads get woken up. If high watermark is equal to low watermark everytime
+ a sleeping producer thread will be woken up and puts its task if one worker
+ thread has taken a task from the channel. If low watermark is less than high
+ watermark all sleeping producer threads will be woken up if the amount of pending
+ tasks reaches low watermark.
+ </p>
+<a name="boost_threadpool.channel.unbounded_channel"></a><h4>
+<a name="id372202"></a>
+ <a class="link" href="channel.html#boost_threadpool.channel.unbounded_channel">unbounded channel</a>
+ </h4>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">SchedulingPolicy</span> <span class="special">&gt;</span> <span class="keyword">class</span> <span class="identifier">unbounded_channel</span>
+</pre>
+<p>
+ An unlimited number of actions can be queued into this channel. The insertion
+ of actions will never block. If the channel becomes empty worker threads will
+ be set to sleep until new actions are inserted into the channel.
+ </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 © 2008 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="this_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="scheduling.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/threadpool/libs/tp/doc/html/boost_threadpool/forkjoin.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/boost_threadpool/forkjoin.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,125 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Fork/Join</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="prev" href="scheduling.html" title="Scheduling">
+<link rel="next" href="acknowledgement.html" title="Acknowledgements">
+</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="scheduling.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="acknowledgement.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.forkjoin"></a><a class="link" href="forkjoin.html" title="Fork/Join"> Fork/Join</a>
+</h2></div></div></div>
+<p>
+ Fork/Join algorithms are recursive divide-and-conquer algorithms which repeatedly
+ splitt sub_actions until they become small enough to solve using simple, short
+ sequential methods, so that they run in parallel on multiple cores.
+ </p>
+<p>
+ The fork operation creates a new sub_action (which can run in parallel) in
+ the pool. The current actions is not proceeded in the join operation until
+ the forked sub_actions have completed. In the meantime the worker thread executes
+ other actions from its local <a class="link" href="pool.html#boost_threadpool.pool.work_stealing"><span class="emphasis"><em>worker
+ queue</em></span></a>.
+ </p>
+<pre class="programlisting"><span class="comment">// defines the threadpool type
+</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool_type</span><span class="special">;</span>
+
+<span class="keyword">class</span> <span class="identifier">fibo</span>
+<span class="special">{</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">pool_type</span> <span class="special">&amp;</span> <span class="identifier">pool_</span><span class="special">;</span>
+ <span class="keyword">int</span> <span class="identifier">cutoff_</span><span class="special">;</span>
+
+ <span class="keyword">int</span> <span class="identifier">seq_</span><span class="special">(</span> <span class="keyword">int</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">1</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">seq_</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="identifier">seq_</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="keyword">int</span> <span class="identifier">par_</span><span class="special">(</span> <span class="keyword">int</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="identifier">cutoff_</span><span class="special">)</span> <span class="keyword">return</span> <span class="identifier">seq_</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">// fork a new sub-action t1 in pool
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t1</span><span class="special">(</span>
+ <span class="identifier">pool_</span><span class="special">.</span><span class="identifier">submit</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="special">&amp;</span> <span class="identifier">fibo</span><span class="special">::</span><span class="identifier">par_</span><span class="special">,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="special">*</span> <span class="keyword">this</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="special">);</span>
+
+ <span class="comment">// fork a new sub-action t2 in pool
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t1</span><span class="special">(</span>
+ <span class="identifier">pool_</span><span class="special">.</span><span class="identifier">submit</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="special">&amp;</span> <span class="identifier">fibo</span><span class="special">::</span><span class="identifier">par_</span><span class="special">,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="special">*</span> <span class="keyword">this</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="special">);</span>
+
+ <span class="comment">// joining the result of sub-action t1 and t2
+</span> <span class="keyword">return</span> <span class="identifier">t1</span><span class="special">.</span><span class="identifier">get</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">t2</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">public</span><span class="special">:</span>
+ <span class="identifier">fibo</span><span class="special">(</span> <span class="identifier">pool_type</span> <span class="special">&amp;</span> <span class="identifier">pool</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">cutoff</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">pool_</span><span class="special">(</span> <span class="identifier">pool</span><span class="special">),</span> <span class="identifier">cutoff_</span><span class="special">(</span> <span class="identifier">cutoff</span><span class="special">)</span>
+ <span class="special">{}</span>
+
+ <span class="keyword">int</span> <span class="identifier">execute</span><span class="special">(</span> <span class="keyword">int</span> <span class="identifier">n</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">result</span><span class="special">(</span> <span class="identifier">par_</span><span class="special">(</span> <span class="identifier">n</span><span class="special">)</span> <span class="special">);</span>
+ <span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="comment">// creates a threadpool with two worker-threads
+</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">tp</span><span class="special">::</span><span class="identifier">poolsize</span><span class="special">(</span> <span class="number">2</span><span class="special">)</span> <span class="special">);</span>
+
+<span class="identifier">fibo</span> <span class="identifier">fib</span><span class="special">(</span> <span class="identifier">pool</span><span class="special">,</span> <span class="number">1</span><span class="special">);</span>
+
+<span class="comment">// submit an action
+</span><span class="comment">// which calculates the fibonacci number of 10
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+ <span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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="special">&amp;</span> <span class="identifier">fibo</span><span class="special">::</span><span class="identifier">execute</span><span class="special">,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ref</span><span class="special">(</span> <span class="identifier">fib</span><span class="special">),</span>
+ <span class="number">10</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">t</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="comment">// prints 55
+</span></pre>
+</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 © 2008 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="scheduling.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="acknowledgement.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/threadpool/libs/tp/doc/html/boost_threadpool/pool.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/boost_threadpool/pool.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,284 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Pool</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="prev" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<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" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.pool"></a><a class="link" href="pool.html" title="Pool"> Pool</a>
+</h2></div></div></div>
+<p>
+ The pool manages internaly worker threads and submitted actions are stored
+ in a <a class="link" href="channel.html" title="Channel"><span class="emphasis"><em>channel</em></span></a>
+ (<a class="link" href="pool.html#boost_threadpool.pool.work_stealing"><span class="emphasis"><em>global queue</em></span></a>)
+ for processing by the worker threads (using a <a class="link" href="pool.html#boost_threadpool.pool.work_stealing"><span class="emphasis"><em>work
+ stealing</em></span></a> algorithm). Each submitted action gets associated
+ with a <a class="link" href="task.html" title="Task"><span class="emphasis"><em>task</em></span></a>
+ object that will be returned. The <a class="link" href="task.html" title="Task"><span class="emphasis"><em>task</em></span></a>
+ object acts as a proxy for a result that is initially not known and gets evaluated
+ later by a worker thread.
+ </p>
+<a name="boost_threadpool.pool.work_stealing"></a><h4>
+<a name="id326471"></a>
+ <a class="link" href="pool.html#boost_threadpool.pool.work_stealing">Work-Stealing</a>
+ </h4>
+<p>
+ Traditional thread poola do not scale because they use a single global queue
+ protected by a global lock. The frequency at which worker threads aquire the
+ global lock becomes a limiting factor for the throughput if:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ the actions become smaller
+ </li>
+<li>
+ more processors are added
+ </li>
+</ul></div>
+<p>
+ A work-stealing algorithm can be used to solve this problem. It uses a special
+ kind of queue which has two ends, and allows lock-free pushes and pops from
+ the <span class="emphasis"><em>private end</em></span> (accessed by the worker thread owning
+ the queue), but requires synchronization from the <span class="emphasis"><em>public end</em></span>
+ (accessed by the other worker threads). Synchronization is necessary when the
+ queue is sufficiently small that private and public operations could conflict.
+ </p>
+<p>
+ The pool contains one global queue (<a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a> or <a class="link" href="channel.html#boost_threadpool.channel.unbounded_channel"><span class="emphasis"><em>unbounded
+ channel</em></span></a>) protected by a global lock and each worker thread
+ has its own private worker queue. If work is enqueued by a worker thread the
+ action is stored in the worker queue. If the work is enqueued by a application
+ thread it goes into the global queue. When worker threads are looking for work,
+ they have following search order:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ look into the private worker queue - actions can be dequeued without locks
+ </li>
+<li>
+ look in the global queue - locks are used for synchronization
+ </li>
+<li>
+ check other worker queues ('stealing' actions from private worker queues
+ of other worker threads) - requires locks
+ </li>
+</ul></div>
+<p>
+ For a lot of recursively queued actions, the use of a worker queue per thread
+ substantially reduces the synchronization necessary to complete the work. There
+ are also fewer cache effects due to sharing of the global queue information.
+ </p>
+<p>
+ Operations on the private worker queue are executed in LIFO order and operations
+ on worker queues of other worker threads in FIFO order (steals).
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ There are chances that memory is still hot in the cache, if the actions are
+ pushed in LIFO order into the private worker queue.
+ </li>
+<li>
+ If a worker thread steals work in FIFO order, increases the chances that
+ a larger 'chunk' of work will be stolen (the need for other steals will be
+ possibly reduced). Because the actions are stored in LIFO order, the oldest
+ items are closer to the <span class="emphasis"><em>public end</em></span> of the queue (forming
+ a tree). Stealing such an older action also steals a (probably) larger subtree
+ of actions unfolded if the stolen work item get executed.
+ </li>
+</ul></div>
+<div class="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>
+ Actions submitted by a worker thread are stored into its private worker queue
+ in LIFO order, thatswhy priorities and timeouts specified at the submit-function
+ get ignored.
+ </p></td></tr>
+</table></div>
+<div class="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>
+ Because of the work-stealing algorithm the execution order of actions may
+ be not strict as in the global queue.
+ </p></td></tr>
+</table></div>
+<a name="boost_threadpool.pool.creation"></a><h4>
+<a name="id367698"></a>
+ <a class="link" href="pool.html#boost_threadpool.pool.creation">Creation</a>
+ </h4>
+<p>
+ The first template argument specifies the channel type and the scheduling policy.
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</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="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="identifier">boost</span><span class="special">::</span><span class="identifier">tp</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>
+</pre>
+<p>
+ In the example above a thread pool is created with a <a class="link" href="channel.html#boost_threadpool.channel.unbounded_channel"><span class="emphasis"><em>unbounded
+ channel</em></span></a>, scheduling actions in <span class="emphasis"><em>FIFO</em></span>
+ order. The pool contains six worker threads going to sleep for 50 millisec
+ after 10 iterations without geting an action from the <a class="link" href="pool.html#boost_threadpool.pool.work_stealing"><span class="emphasis"><em>global
+ queue</em></span></a>, from its local <a class="link" href="pool.html#boost_threadpool.pool.work_stealing"><span class="emphasis"><em>worker
+ queue</em></span></a> or local queues of other worker threads.
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">bounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">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">tp</span><span class="special">::</span><span class="identifier">poolsize</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">tp</span><span class="special">::</span><span class="identifier">high_watermark</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">tp</span><span class="special">::</span><span class="identifier">low_watermark</span><span class="special">(</span> <span class="number">5</span><span class="special">)</span> <span class="special">);</span>
+</pre>
+<p>
+ This pool uses a <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a> which schedules actions by integer atrributes. A
+ maximum of 10 actions can be queued in the <a class="link" href="pool.html#boost_threadpool.pool.work_stealing"><span class="emphasis"><em>global
+ queue</em></span></a> without blocking the inserting thread.
+ </p>
+<a name="boost_threadpool.pool.shutdown"></a><h4>
+<a name="id368199"></a>
+ <a class="link" href="pool.html#boost_threadpool.pool.shutdown">Shutdown</a>
+ </h4>
+<p>
+ If <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;::</span><span class="identifier">shutdown</span><span class="special">()</span></code> is called - the the status of the pool is
+ set to <span class="emphasis"><em>terminating</em></span> and all worker threads are joined.
+ No futher actions can be submitted by application threads. After all pending
+ actions are processed and all worker threads are joined, the pool is set to
+ status <span class="emphasis"><em>terminated</em></span>.
+ </p>
+<div class="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">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;::</span><span class="identifier">shutdown</span><span class="special">()</span></code>
+ if the pool was not shutdown yet.
+ </p></td></tr>
+</table></div>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</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="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t1</span><span class="special">(</span>
+ <span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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="special">);</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t2</span><span class="special">(</span>
+ <span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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="special">);</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="identifier">t1</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="comment">// 55
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">t2</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="comment">// 55
+</span></pre>
+<a name="boost_threadpool.pool.shutdown_immediatly"></a><h4>
+<a name="id368828"></a>
+ <a class="link" href="pool.html#boost_threadpool.pool.shutdown_immediatly">Shutdown immediatly</a>
+ </h4>
+<p>
+ The function <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;::</span><span class="identifier">shutdown_now</span><span class="special">()</span></code> sets the pool status to <span class="emphasis"><em>terminating</em></span>
+ interrupts and then joins all worker threads. After the worker threads are
+ joined the status of the pool is set to <span class="emphasis"><em>terminated</em></span> and
+ all pending (unprocessed) actions will be returned.
+ </p>
+<div class="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>
+ Pending actions in the local <a class="link" href="pool.html#boost_threadpool.pool.work_stealing"><span class="emphasis"><em>worker
+ queues</em></span></a> are not returned if <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span> <span class="special">&gt;::</span><span class="identifier">shutdown_now</span><span class="special">()</span></code>
+ was called.
+ </p></td></tr>
+</table></div>
+<a name="boost_threadpool.pool.meta_functions"></a><h4>
+<a name="id368961"></a>
+ <a class="link" href="pool.html#boost_threadpool.pool.meta_functions">Meta functions</a>
+ </h4>
+<p>
+ If the thread pool supports priorities <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">has_priority</span><span class="special">&lt;</span>
+ <span class="identifier">pool_type</span> <span class="special">&gt;</span></code>
+ evaluates to <code class="computeroutput"><span class="keyword">true</span></code>. The priority
+ type is determined by <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">priority_type</span><span class="special">&lt;</span>
+ <span class="identifier">pool_type</span> <span class="special">&gt;</span></code>.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">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="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">tp</span><span class="special">::</span><span class="identifier">has_priority</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="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="keyword">typeid</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">priority_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>
+ The support of fibers can be tested with meta-function <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">has_fibers</span><span class="special">&lt;</span>
+ <span class="identifier">pool_type</span> <span class="special">&gt;</span></code>.
+ </p>
+<pre class="programlisting"><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">tp</span><span class="special">::</span><span class="identifier">has_fibers</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="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+</pre>
+<a name="boost_threadpool.pool.processor_binding"></a><h4>
+<a name="id369535"></a>
+ <a class="link" href="pool.html#boost_threadpool.pool.processor_binding">Processor binding</a>
+ </h4>
+<p>
+ For some applications it is convenient to bind the worker threads of the pool
+ to processors of the system. For this purpose BOOST_BIND_WORKER_TO_PROCESSORS
+ must be defined. Without the poolsize in the construtor the thread pool will
+ contain as many worker threads as processors (== boost::thread::hardware_concurrency)
+ are available and each worker thread is bound to one processor.
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+ <span class="special">&gt;</span> <span class="identifier">pool</span><span class="special">;</span>
+</pre>
+<p>
+ The code above will create a pool with two worker threads on a dual core system
+ (each bound to one core).
+ </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 © 2008 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/threadpool/libs/tp/doc/html/boost_threadpool/reference.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/boost_threadpool/reference.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,1652 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Reference</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="prev" href="acknowledgement.html" title="Acknowledgements">
+</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="acknowledgement.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" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.reference"></a><a class="link" href="reference.html" title="Reference"> Reference</a>
+</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Class template pool</span></dt>
+<dt><span class="section"> Class template task</span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.wait_for_all"> Non-member
+ function <code class="computeroutput"><span class="identifier">wait_for_all</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.wait_for_any"> Non-member
+ function <code class="computeroutput"><span class="identifier">wait_for_any</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.get_thread_pool"> Non-member
+ templated function <code class="computeroutput"><span class="identifier">get_thread_pool</span></code></a></span></dt>
+<dt><span class="section"> Class poolsize</span></dt>
+<dt><span class="section"> Class scanns</span></dt>
+<dt><span class="section"> Class high_watermark</span></dt>
+<dt><span class="section"> Class low_watermark</span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.invalid_poolsize"> Class
+ <code class="computeroutput"><span class="identifier">invalid_poolsize</span></code></a></span></dt>
+<dt><span class="section"> Class invalid_scanns</span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.invalid_timeduration"> Class
+ <code class="computeroutput"><span class="identifier">invalid_timeduration</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.invalid_watermark"> Class
+ <code class="computeroutput"><span class="identifier">invalid_watermark</span></code></a></span></dt>
+<dt><span class="section"> Class task_rejected</span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.has_priority"> Meta function
+ <code class="computeroutput"><span class="identifier">has_priority</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.priority_type"> Meta function
+ <code class="computeroutput"><span class="identifier">priority_type</span></code></a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.pool"></a><a class="link" href="reference.html#boost_threadpool.reference.pool" title="Class template pool"> Class template <code class="computeroutput"><span class="identifier">pool</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.constructor_unbounded_channel_hw">
+ Constructor (unbounded channel)</a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.constructor_unbounded_channel">
+ Constructor (unbounded channel)</a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.constructor_bounded_channel_hw">
+ Constructor (bounded channel)</a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.constructor_bounded_channel">
+ Constructor (bounded channel)</a></span></dt>
+<dt><span class="section"> Destructor</span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.size"> Member function
+ <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.active"> Member function
+ <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.idle"> Member function
+ <code class="computeroutput"><span class="identifier">idle</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.shutdown"> Member function
+ <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.shutdown_now"> Member
+ function <code class="computeroutput"><span class="identifier">shutdown_now</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.terminated"> Member
+ function <code class="computeroutput"><span class="identifier">terminated</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.terminateing"> Member
+ function <code class="computeroutput"><span class="identifier">terminateing</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.clear"> Member function
+ <code class="computeroutput"><span class="identifier">clear</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.empty"> Member function
+ <code class="computeroutput"><span class="identifier">empty</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.pending"> Member function
+ <code class="computeroutput"><span class="identifier">pending</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.get_upper_bound"> Member
+ function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.set_upper_bound"> Member
+ function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">(</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.get_lower_bound"> Member
+ function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.set_lower_bound"> Member
+ function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">(</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.submit"> Member function
+ <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
+ <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">act</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.pool.submit_attr"> Member
+ function <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
+ <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">act</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">attr</span><span class="special">)</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">pool</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Channel</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">pool</span>
+<span class="special">:</span> <span class="keyword">private</span> <span class="identifier">noncopyable</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">poolsize</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">psize</span><span class="special">,</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span> <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">poolsize</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">psize</span><span class="special">,</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">,</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</span><span class="special">,</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">100</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">);</span>
+
+
+ <span class="keyword">explicit</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span> <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="keyword">explicit</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">,</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</span><span class="special">,</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">100</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">);</span>
+
+ <span class="special">~</span><span class="identifier">pool</span><span class="special">();</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">active</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">idle</span><span class="special">();</span>
+
+ <span class="keyword">void</span> <span class="identifier">shutdown</span><span class="special">();</span>
+ <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">callable</span> <span class="special">&gt;</span> <span class="identifier">shutdown_now</span><span class="special">();</span>
+
+ <span class="keyword">bool</span> <span class="identifier">terminated</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">terminateing</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">clear</span><span class="special">();</span>
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pending</span><span class="special">();</span>
+
+ <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">upper_bound</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">upper_bound</span><span class="special">(</span> <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">);</span>
+ <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">lower_bound</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">lower_bound</span><span class="special">(</span> <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</span><span class="special">);</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Act</span> <span class="special">&gt;</span>
+ <span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">&lt;</span> <span class="identifier">Act</span><span class="special">()</span> <span class="special">&gt;::</span><span class="identifier">type</span> <span class="special">&gt;</span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">act</span><span class="special">);</span>
+
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Act</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Attr</span> <span class="special">&gt;</span>
+ <span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">&lt;</span> <span class="identifier">Act</span><span class="special">()</span> <span class="special">&gt;::</span><span class="identifier">type</span> <span class="special">&gt;</span> <span class="identifier">submit</span><span class="special">(</span>
+ <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">act</span><span class="special">,</span>
+ <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">attr</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.constructor_unbounded_channel_hw"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.constructor_unbounded_channel_hw" title="Constructor (unbounded channel)">
+ Constructor (unbounded channel)</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span> <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ Operating system provides functionality for processor pining.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span>
+ <span class="special">&gt;</span></code> instance. For each processor
+ a worker-thread is created and each worker-thread is pined exactly
+ to one processor.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Constructor has to be called if a <a class="link" href="channel.html#boost_threadpool.channel.unbounded_channel"><span class="emphasis"><em>unbounded
+ channel</em></span></a> is used.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.constructor_unbounded_channel"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.constructor_unbounded_channel" title="Constructor (unbounded channel)">
+ Constructor (unbounded channel)</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">poolsize</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">psize</span><span class="special">,</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span> <span class="number">10</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span>
+ <span class="special">&gt;</span></code> instance. Pool contains
+ psize worker-threads.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Constructor has to be called if a <a class="link" href="channel.html#boost_threadpool.channel.unbounded_channel"><span class="emphasis"><em>unbounded
+ channel</em></span></a> is used.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.constructor_bounded_channel_hw"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.constructor_bounded_channel_hw" title="Constructor (bounded channel)">
+ Constructor (bounded channel)</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">,</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</span><span class="special">,</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">100</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ Operating system provides functionality for processor pining.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span>
+ <span class="special">&gt;</span></code> instance. For each processor
+ a worker-thread is created and each worker-thread is pined exactly
+ to one processor.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>,
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Constructor has to be called if a <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a> is used.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.constructor_bounded_channel"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.constructor_bounded_channel" title="Constructor (bounded channel)">
+ Constructor (bounded channel)</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">pool</span><span class="special">(</span>
+ <span class="identifier">poolsize</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">psize</span><span class="special">,</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">,</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</span><span class="special">,</span>
+ <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">time_duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">asleep</span> <span class="special">=</span> <span class="identifier">posix_time</span><span class="special">::</span><span class="identifier">milliseconds</span><span class="special">(</span> <span class="number">100</span><span class="special">),</span>
+ <span class="identifier">scanns</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">scns</span> <span class="special">=</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="number">20</span><span class="special">)</span> <span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span> <span class="identifier">Channel</span>
+ <span class="special">&gt;</span></code> instance. Pool contains
+ psize worker-threads.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>,
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Constructor has to be called if a <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a> is used.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.destructor"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.destructor" title="Destructor"> Destructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="special">~</span><span class="identifier">pool</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Calls <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">Channel</span> <span class="special">&gt;::</span><span class="identifier">shutdown</span><span class="special">()</span></code>
+ if not yet called.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.size"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.size" title="Member function size()"> Member function
+ <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">size</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns how many worker threads are running in the pool.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.active"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.active" title="Member function active()"> Member function
+ <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">active</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns how many worker threads are active (executing an action).
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.idle"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.idle" title="Member function idle()"> Member function
+ <code class="computeroutput"><span class="identifier">idle</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">idle</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns how many worker threads are idle (not executing an action).
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ The value is the difference of <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">active</span><span class="special">()</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.shutdown"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.shutdown" title="Member function shutdown()"> Member function
+ <code class="computeroutput"><span class="identifier">shutdown</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">shutdown</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Changes the pool state to <span class="emphasis"><em>terminating</em></span>, deactivates
+ the channel and joins all worker threads. The status of the pool is
+ assigned to <span class="emphasis"><em>terminated</em></span> at the end.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ All pending actions are processed.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.shutdown_now"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.shutdown_now" title="Member function shutdown_now()"> Member
+ function <code class="computeroutput"><span class="identifier">shutdown_now</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span> <span class="identifier">callable</span> <span class="special">&gt;</span> <span class="identifier">shutdown_now</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Changes the pool state to <span class="emphasis"><em>terminating</em></span>, deactivates
+ the channel, send interruption request to all worker threads and joins
+ them. The status of the pool is assigned to <span class="emphasis"><em>terminated</em></span>
+ at the end.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Pending actions are not processed but returned.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.terminated"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.terminated" title="Member function terminated()"> Member
+ function <code class="computeroutput"><span class="identifier">terminated</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">terminated</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Queries if the pool is in the terminated state (pool is shutdown).
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.terminateing"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.terminateing" title="Member function terminateing()"> Member
+ function <code class="computeroutput"><span class="identifier">terminateing</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">terminateing</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Queries if the pool is in the terminating state (tries to shutdown
+ the pool).
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.clear"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.clear" title="Member function clear()"> Member function
+ <code class="computeroutput"><span class="identifier">clear</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">clear</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Removes all pending actions from the <a class="link" href="channel.html" title="Channel"><span class="emphasis"><em>channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.empty"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.empty" title="Member function empty()"> Member function
+ <code class="computeroutput"><span class="identifier">empty</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Queries if the <a class="link" href="channel.html" title="Channel"><span class="emphasis"><em>channel</em></span></a>
+ is empty.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.pending"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.pending" title="Member function pending()"> Member function
+ <code class="computeroutput"><span class="identifier">pending</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pending</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Queries how many actions are pending in the <a class="link" href="channel.html" title="Channel"><span class="emphasis"><em>channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.get_upper_bound"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.get_upper_bound" title="Member function upper_bound()"> Member
+ function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">upper_bound</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ Channel is of type <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns the upper bound of the <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Can only be used if a <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a> is used.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.set_upper_bound"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.set_upper_bound" title="Member function upper_bound( high_watermark const&amp; hwm)"> Member
+ function <code class="computeroutput"><span class="identifier">upper_bound</span><span class="special">(</span>
+ <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">)</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">upper_bound</span><span class="special">(</span> <span class="identifier">high_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">hwm</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ Channel is of type <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Sets the upper bound of the <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">upper_bound</span><span class="special">()</span>
+ <span class="special">==</span> <span class="identifier">hwm</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Can only be used if a <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a> is used.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.get_lower_bound"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.get_lower_bound" title="Member function lower_bound()"> Member
+ function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">lower_bound</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ Channel is of type <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns the lower bound of the <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Can only be used if a <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a> is used.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.set_lower_bound"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.set_lower_bound" title="Member function lower_bound( low_watermark const&amp; lwm)"> Member
+ function <code class="computeroutput"><span class="identifier">lower_bound</span><span class="special">(</span>
+ <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</span><span class="special">)</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">lower_bound</span><span class="special">(</span> <span class="identifier">low_watermark</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">lwm</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ Channel is of type <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Sets the lower bound of the <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a>.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="keyword">this</span><span class="special">-&gt;</span><span class="identifier">lower_bound</span><span class="special">()</span>
+ <span class="special">==</span> <span class="identifier">lwm</span></code>.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ Can only be used if a <a class="link" href="channel.html#boost_threadpool.channel.bounded_channel"><span class="emphasis"><em>bounded
+ channel</em></span></a> is used.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.submit"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.submit" title="Member function submit( Act const&amp; act)"> Member function
+ <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
+ <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">act</span><span class="special">)</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Act</span> <span class="special">&gt;</span>
+<span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">&lt;</span> <span class="identifier">Act</span><span class="special">()</span> <span class="special">&gt;::</span><span class="identifier">type</span> <span class="special">&gt;</span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">act</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ has_priority&lt; pool &gt;::value == false &amp;&amp; ! ( pool.terminating()
+ || pool.terminated() )
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Submits an action to the pool and returns a <a class="link" href="task.html" title="Task"><span class="emphasis"><em>task</em></span></a>
+ object.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task_rejected</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.pool.submit_attr"></a><a class="link" href="reference.html#boost_threadpool.reference.pool.submit_attr" title="Member function submit( Act const&amp; act, Attr const&amp; attr)"> Member
+ function <code class="computeroutput"><span class="identifier">submit</span><span class="special">(</span>
+ <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">act</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">attr</span><span class="special">)</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Act</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Attr</span> <span class="special">&gt;</span>
+<span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">result_of</span><span class="special">&lt;</span> <span class="identifier">Act</span><span class="special">()</span> <span class="special">&gt;::</span><span class="identifier">type</span> <span class="special">&gt;</span> <span class="identifier">submit</span><span class="special">(</span> <span class="identifier">Act</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">act</span><span class="special">,</span> <span class="identifier">Attr</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">attr</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ has_priority&lt; pool &gt;::value == true &amp;&amp; ! ( pool.terminating()
+ || pool.terminated() )
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Submits an action to the pool and returns a <a class="link" href="task.html" title="Task"><span class="emphasis"><em>task</em></span></a>
+ object. <span class="underline">_Action</span>_ is scheduled
+ by the attribute.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task_rejected</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.task"></a><a class="link" href="reference.html#boost_threadpool.reference.task" title="Class template task"> Class template <code class="computeroutput"><span class="identifier">task</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Constructor</span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.interrupt"> Member
+ function <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.interrupt_and_wait">
+ Member function <code class="computeroutput"><span class="identifier">interrupt_and_wait</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.get"> Member function
+ <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.is_read"> Member function
+ <code class="computeroutput"><span class="identifier">is_ready</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.has_value"> Member
+ function <code class="computeroutput"><span class="identifier">has_value</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.has_exception"> Member
+ function <code class="computeroutput"><span class="identifier">has_exception</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.wait"> Member function
+ <code class="computeroutput"><span class="identifier">wait</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.timed_wait"> Member
+ function <code class="computeroutput"><span class="identifier">timed_wait</span><span class="special">()</span></code></a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.task.timed_wait_until">
+ Member function <code class="computeroutput"><span class="identifier">timed_wait_until</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">task</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">R</span> <span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">task</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pool</span> <span class="special">&gt;</span>
+ <span class="identifier">task</span><span class="special">(</span>
+ <span class="identifier">Pool</span> <span class="special">*</span> <span class="identifier">pool</span><span class="special">,</span>
+ <span class="identifier">future</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">fut</span><span class="special">,</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">interrupter</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">intr</span><span class="special">);</span>
+
+ <span class="keyword">void</span> <span class="identifier">interrupt</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">interrupt_and_wait</span><span class="special">();</span>
+ <span class="keyword">void</span> <span class="identifier">interrupt_and_wait</span><span class="special">(</span> <span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">abs_time</span><span class="special">);</span>
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Duration</span> <span class="special">&gt;</span>
+ <span class="keyword">void</span> <span class="identifier">interrupt_and_wait</span><span class="special">(</span> <span class="identifier">Duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+ <span class="keyword">bool</span> <span class="identifier">interrupt_requested</span><span class="special">();</span>
+
+ <span class="identifier">R</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="keyword">bool</span> <span class="identifier">is_ready</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">bool</span> <span class="identifier">has_value</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">bool</span> <span class="identifier">has_exception</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+
+ <span class="keyword">void</span> <span class="identifier">wait</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Duration</span> <span class="special">&gt;</span>
+ <span class="keyword">bool</span> <span class="identifier">timed_wait</span><span class="special">(</span> <span class="identifier">Duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+ <span class="keyword">bool</span> <span class="identifier">timed_wait_until</span><span class="special">(</span> <span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">abs_time</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.task.constructor" title="Constructor"> Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pool</span> <span class="special">&gt;</span>
+<span class="identifier">task</span><span class="special">(</span>
+ <span class="identifier">Pool</span> <span class="special">*</span> <span class="identifier">pool</span><span class="special">,</span>
+ <span class="identifier">future</span><span class="special">&lt;</span> <span class="identifier">R</span> <span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">fut</span><span class="special">,</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">interrupter</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">intr</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">R</span>
+ <span class="special">&gt;</span></code> instance.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+<dt><span class="term">Notes:</span></dt>
+<dd><p>
+ task objects should only be constructed by the pool.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.interrupt"></a><a class="link" href="reference.html#boost_threadpool.reference.task.interrupt" title="Member function interrupt()"> Member
+ function <code class="computeroutput"><span class="identifier">interrupt</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Associated action will be interrupted the next time it enters a <a class="link" href="task.html#boost_threadpool.task.interruption"><span class="emphasis"><em>interruption
+ point</em></span></a> if interruption is not disabled. The function
+ returns immediatly.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.interrupt_and_wait"></a><a class="link" href="reference.html#boost_threadpool.reference.task.interrupt_and_wait" title="Member function interrupt_and_wait()">
+ Member function <code class="computeroutput"><span class="identifier">interrupt_and_wait</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">interrupt_and_wait</span><span class="special">();</span>
+
+<span class="keyword">void</span> <span class="identifier">interrupt_and_wait</span><span class="special">(</span> <span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">abs_time</span><span class="special">);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">DurationTime</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">interrupt_and_wait</span><span class="special">(</span> <span class="identifier">DurationTime</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">rel_time</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Associated action will be interrupted the next time it enters one
+ <a class="link" href="task.html#boost_threadpool.task.interruption"><span class="emphasis"><em>interruption
+ point</em></span></a> if interruption is not disabled. The function
+ waits until the action has terminated or the specified duration td
+ has elapsed.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.get"></a><a class="link" href="reference.html#boost_threadpool.reference.task.get" title="Member function get()"> Member function
+ <code class="computeroutput"><span class="identifier">get</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">R</span> <span class="identifier">get</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns fulfilled value or throws fulfilled exception.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">future</span><span class="special">::</span><span class="identifier">broken_promise</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.is_read"></a><a class="link" href="reference.html#boost_threadpool.reference.task.is_read" title="Member function is_ready()"> Member function
+ <code class="computeroutput"><span class="identifier">is_ready</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">is_ready</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Queries if the action has been fulfilled.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.has_value"></a><a class="link" href="reference.html#boost_threadpool.reference.task.has_value" title="Member function has_value()"> Member
+ function <code class="computeroutput"><span class="identifier">has_value</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">has_value</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Queries if the action has been fulfilled (is ready) and has a value.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.has_exception"></a><a class="link" href="reference.html#boost_threadpool.reference.task.has_exception" title="Member function has_exception()"> Member
+ function <code class="computeroutput"><span class="identifier">has_exception</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">has_exception</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Queries if the action has been fulfilled (is ready) and has an exception.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.wait"></a><a class="link" href="reference.html#boost_threadpool.reference.task.wait" title="Member function wait()"> Member function
+ <code class="computeroutput"><span class="identifier">wait</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">wait</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Waits until the result is ready.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Throws thread_interrupted if the result is not ready at the point of
+ the call, and the current thread is interrupted.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.timed_wait"></a><a class="link" href="reference.html#boost_threadpool.reference.task.timed_wait" title="Member function timed_wait()"> Member
+ function <code class="computeroutput"><span class="identifier">timed_wait</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Duration</span> <span class="special">&gt;</span>
+<span class="keyword">bool</span> <span class="identifier">timed_wait</span><span class="special">(</span> <span class="identifier">Duration</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">wait_duration</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Waits until the result is ready, or returns false if the time specified
+ by wait_duration has elapsed.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Throws thread_interrupted if the result is not ready at the point of
+ the call, and the current thread is interrupted.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task.timed_wait_until"></a><a class="link" href="reference.html#boost_threadpool.reference.task.timed_wait_until" title="Member function timed_wait_until()">
+ Member function <code class="computeroutput"><span class="identifier">timed_wait_until</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">timed_wait_until</span><span class="special">(</span> <span class="identifier">system_time</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">wait_timeout</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Waits until the result is ready, or returns false if the time point
+ specified by wait_timeout has passed.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Throws thread_interrupted if the result is not ready at the point of
+ the call, and the current thread is interrupted.
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.wait_for_all"></a><a class="link" href="reference.html#boost_threadpool.reference.wait_for_all" title="Non-member function wait_for_all"> Non-member
+ function <code class="computeroutput"><span class="identifier">wait_for_all</span></code></a>
+</h3></div></div></div>
+<pre class="programlisting"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">task</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">wait_for_all</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">wait_for_all</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">wait_for_all</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="special">&amp;);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T5</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">wait_for_all</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T5</span> <span class="special">&gt;</span> <span class="special">&amp;);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Waits until all specified tasks are ready.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Any exceptions that might be thrown by the actions.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.wait_for_any"></a><a class="link" href="reference.html#boost_threadpool.reference.wait_for_any" title="Non-member function wait_for_any"> Non-member
+ function <code class="computeroutput"><span class="identifier">wait_for_any</span></code></a>
+</h3></div></div></div>
+<pre class="programlisting"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">task</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">wait_for_any</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">wait_for_any</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">wait_for_any</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="special">&amp;);</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T3</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T4</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T5</span> <span class="special">&gt;</span>
+<span class="keyword">void</span> <span class="identifier">wait_for_any</span><span class="special">(</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T1</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T2</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T3</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T4</span> <span class="special">&gt;</span> <span class="special">&amp;,</span> <span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T5</span> <span class="special">&gt;</span> <span class="special">&amp;);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Waits until at leaste one of specified tasks is ready.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Any exceptions that might be thrown by the actions.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.get_thread_pool"></a><a class="link" href="reference.html#boost_threadpool.reference.get_thread_pool" title="Non-member templated function get_thread_pool"> Non-member
+ templated function <code class="computeroutput"><span class="identifier">get_thread_pool</span></code></a>
+</h3></div></div></div>
+<pre class="programlisting"> <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">pool</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pool</span> <span class="special">&gt;</span>
+<span class="identifier">Pool</span> <span class="special">&amp;</span> <span class="identifier">get_thread_pool</span><span class="special">();</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd>
+<p>
+ Returns reference to the thread pool where the current worker thread
+ is running.
+ </p>
+<p>
+ [Throws:
+ </p>
+<p>
+ Nothing.
+ </p>
+</dd>
+<dt><span class="term">Note:</span></dt>
+<dd><p>
+ This function resides in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span></code>.
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.poolsize"></a><a class="link" href="reference.html#boost_threadpool.reference.poolsize" title="Class poolsize"> Class <code class="computeroutput"><span class="identifier">poolsize</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Constructor</span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.poolsize.operator"> Member
+ function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">poolsize</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">poolsize</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">poolsize</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">);</span>
+
+ <span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.poolsize.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.poolsize.constructor" title="Constructor"> Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">poolsize</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ value &gt; 0
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">poolsize</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ operator std::size_t () &gt; 0
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_poolsize</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.poolsize.operator"></a><a class="link" href="reference.html#boost_threadpool.reference.poolsize.operator" title="Member function operator std::size_t()"> Member
+ function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns pool size.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.scanns"></a><a class="link" href="reference.html#boost_threadpool.reference.scanns" title="Class scanns"> Class <code class="computeroutput"><span class="identifier">scanns</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"> Constructor</span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.scanns.operator"> Member
+ function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">scanns</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">scanns</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">);</span>
+
+ <span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.scanns.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.scanns.constructor" title="Constructor"> Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">scanns</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Preconditions:</span></dt>
+<dd><p>
+ value &gt;= 0
+ </p></dd>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">scanns</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Postconditions:</span></dt>
+<dd><p>
+ operator std::size_t () &gt;= 0
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.scanns.operator"></a><a class="link" href="reference.html#boost_threadpool.reference.scanns.operator" title="Member function operator std::size_t()"> Member
+ function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns scanns size.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.high_watermark"></a><a class="link" href="reference.html#boost_threadpool.reference.high_watermark" title="Class high_watermark"> Class <code class="computeroutput"><span class="identifier">high_watermark</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.high_watermark.constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.high_watermark.operator">
+ Member function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">watermark</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">high_watermark</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">high_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">);</span>
+
+ <span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.high_watermark.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.high_watermark.constructor" title="Constructor">
+ Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">high_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">high_watermark</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.high_watermark.operator"></a><a class="link" href="reference.html#boost_threadpool.reference.high_watermark.operator" title="Member function operator std::size_t()">
+ Member function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns high watermark.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.low_watermark"></a><a class="link" href="reference.html#boost_threadpool.reference.low_watermark" title="Class low_watermark"> Class <code class="computeroutput"><span class="identifier">low_watermark</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.low_watermark.constructor">
+ Constructor</a></span></dt>
+<dt><span class="section"><a href="reference.html#boost_threadpool.reference.low_watermark.operator">
+ Member function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a></span></dt>
+</dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">watermark</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">low_watermark</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">low_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">);</span>
+
+ <span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.low_watermark.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.low_watermark.constructor" title="Constructor">
+ Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">low_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">value</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">low_watermark</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ </p></dd>
+</dl>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.low_watermark.operator"></a><a class="link" href="reference.html#boost_threadpool.reference.low_watermark.operator" title="Member function operator std::size_t()">
+ Member function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">()</span></code></a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Returns low watermark.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.invalid_poolsize"></a><a class="link" href="reference.html#boost_threadpool.reference.invalid_poolsize" title="Class invalid_poolsize"> Class
+ <code class="computeroutput"><span class="identifier">invalid_poolsize</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_threadpool.reference.invalid_poolsize.constructor">
+ Constructor</a></span></dt></dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">invalid_poolsize</span>
+<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">invalid_poolsize</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.invalid_poolsize.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.invalid_poolsize.constructor" title="Constructor">
+ Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">invalid_poolsize</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_poolsize</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.invalid_scanns"></a><a class="link" href="reference.html#boost_threadpool.reference.invalid_scanns" title="Class invalid_scanns"> Class <code class="computeroutput"><span class="identifier">invalid_scanns</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_threadpool.reference.invalid_scanns.constructor">
+ Constructor</a></span></dt></dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">invalid_scanns</span>
+<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">invalid_scanns</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.invalid_scanns.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.invalid_scanns.constructor" title="Constructor">
+ Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">invalid_scanns</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_scanns</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.invalid_timeduration"></a><a class="link" href="reference.html#boost_threadpool.reference.invalid_timeduration" title="Class invalid_timeduration"> Class
+ <code class="computeroutput"><span class="identifier">invalid_timeduration</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_threadpool.reference.invalid_timeduration.constructor">
+ Constructor</a></span></dt></dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">invalid_timeduration</span>
+<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">invalid_timeduration</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.invalid_timeduration.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.invalid_timeduration.constructor" title="Constructor">
+ Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">invalid_timeduration</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_timeduration</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.invalid_watermark"></a><a class="link" href="reference.html#boost_threadpool.reference.invalid_watermark" title="Class invalid_watermark"> Class
+ <code class="computeroutput"><span class="identifier">invalid_watermark</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_threadpool.reference.invalid_watermark.constructor">
+ Constructor</a></span></dt></dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">invalid_watermark</span>
+<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">invalid_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.invalid_watermark.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.invalid_watermark.constructor" title="Constructor">
+ Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">invalid_watermark</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">invalid_watermark</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.task_rejected"></a><a class="link" href="reference.html#boost_threadpool.reference.task_rejected" title="Class task_rejected"> Class <code class="computeroutput"><span class="identifier">task_rejected</span></code></a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="reference.html#boost_threadpool.reference.task_rejected.constructor">
+ Constructor</a></span></dt></dl></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">exceptions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">class</span> <span class="identifier">task_rejected</span>
+<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span>
+<span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">task_rejected</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+<span class="special">};</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_threadpool.reference.task_rejected.constructor"></a><a class="link" href="reference.html#boost_threadpool.reference.task_rejected.constructor" title="Constructor">
+ Constructor</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="identifier">task_rejected</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">msg</span><span class="special">);</span>
+</pre>
+<div class="variablelist">
+<p class="title"><b></b></p>
+<dl>
+<dt><span class="term">Effects:</span></dt>
+<dd><p>
+ Constructs a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task_rejected</span></code>
+ instance.
+ </p></dd>
+<dt><span class="term">Throws:</span></dt>
+<dd><p>
+ Nothing
+ </p></dd>
+</dl>
+</div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.has_priority"></a><a class="link" href="reference.html#boost_threadpool.reference.has_priority" title="Meta function has_priority"> Meta function
+ <code class="computeroutput"><span class="identifier">has_priority</span></code></a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">info</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pool</span> <span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">has_priority</span>
+<span class="special">:</span>
+<span class="keyword">public</span> <span class="identifier">mpl</span><span class="special">::</span><span class="identifier">bool_</span><span class="special">&lt;</span>
+ <span class="identifier">is_same</span><span class="special">&lt;</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">has_priority</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Pool</span><span class="special">::</span><span class="identifier">scheduler_type</span><span class="special">::</span><span class="identifier">priority_tag_type</span>
+ <span class="special">&gt;::</span><span class="identifier">value</span>
+<span class="special">&gt;</span>
+<span class="special">{};</span>
+</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_threadpool.reference.priority_type"></a><a class="link" href="reference.html#boost_threadpool.reference.priority_type" title="Meta function priority_type"> Meta function
+ <code class="computeroutput"><span class="identifier">priority_type</span></code></a>
+</h3></div></div></div>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">info</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Pool</span> <span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">priority_type</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Pool</span><span class="special">::</span><span class="identifier">scheduler_type</span><span class="special">::</span><span class="identifier">attribute_type</span> <span class="identifier">type</span><span class="special">;</span>
+<span class="special">};</span>
+</pre>
+</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 © 2008 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="acknowledgement.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/threadpool/libs/tp/doc/html/boost_threadpool/scheduling.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/boost_threadpool/scheduling.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,132 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Scheduling</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="prev" href="channel.html" title="Channel">
+<link rel="next" href="forkjoin.html" title="Fork/Join">
+</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="channel.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="forkjoin.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.scheduling"></a><a class="link" href="scheduling.html" title="Scheduling"> Scheduling</a>
+</h2></div></div></div>
+<p>
+ The scheduling policy determines how actions are scheduled inside the <a class="link" href="channel.html" title="Channel"><span class="emphasis"><em>channel</em></span></a>.
+ </p>
+<a name="boost_threadpool.scheduling.fifo"></a><h4>
+<a name="id372284"></a>
+ <a class="link" href="scheduling.html#boost_threadpool.scheduling.fifo">fifo</a>
+ </h4>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">fifo</span>
+</pre>
+<p>
+ First inserted pending action get taken first.
+ </p>
+<a name="boost_threadpool.scheduling.lifo"></a><h4>
+<a name="id372316"></a>
+ <a class="link" href="scheduling.html#boost_threadpool.scheduling.lifo">lifo</a>
+ </h4>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">lifo</span>
+</pre>
+<p>
+ Last inserted pending action get taken first.
+ </p>
+<a name="boost_threadpool.scheduling.priority"></a><h4>
+<a name="id372349"></a>
+ <a class="link" href="scheduling.html#boost_threadpool.scheduling.priority">priority</a>
+ </h4>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Attr</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Ord</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="identifier">Attr</span> <span class="special">&gt;</span> <span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">priority</span>
+</pre>
+<p>
+ Each pending task is associated with a priority attribute which is used for
+ ordering actions.
+ </p>
+<a name="boost_threadpool.scheduling.smart"></a><h4>
+<a name="id372455"></a>
+ <a class="link" href="scheduling.html#boost_threadpool.scheduling.smart">smart</a>
+ </h4>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">typename</span> <span class="identifier">Attr</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Ord</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Enq</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Deq</span> <span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">smart</span>
+</pre>
+<p>
+ Each pending actions is associated with an attribute. The scheduler gets an
+ put- and take-policy as template arguments. The corresponding policy get applied
+ for each insertion and removal.
+ </p>
+<p>
+ <span class="bold"><strong>Boost.Threadpool</strong></span> provides <span class="emphasis"><em>boost::tp::replace_oldest</em></span>
+ as put policy and <span class="emphasis"><em>boost::tp::take_oldest</em></span> as take policy.
+ Both policies allow the replacement of old actions in the scheduler by new
+ ones.
+ </p>
+<pre class="programlisting"><span class="comment">// creates a pool with unbounded channel
+</span><span class="comment">// tasks are processed depending on the associated attributed
+</span><span class="comment">// oldest tasks with the same attributed pending in the channel
+</span><span class="comment">// will be replaced by the new task
+</span><span class="comment">// this example would execute add( 1, 2) and add( 5, 6)
+</span><span class="comment">// add( 2, 3) is removed (if pending when add( 5, 6) is submitted)
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">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">tp</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">tp</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</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</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="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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">add_fn</span><span class="special">,</span>
+ <span class="number">1</span><span class="special">,</span>
+ <span class="number">2</span><span class="special">),</span>
+ <span class="number">0</span><span class="special">);</span>
+
+<span class="comment">// replaced by later task with same attribute
+</span><span class="comment">// if still pending in pool
+</span><span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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">add_fn</span><span class="special">,</span>
+ <span class="number">3</span><span class="special">,</span>
+ <span class="number">4</span><span class="special">),</span>
+ <span class="number">1</span><span class="special">);</span>
+
+<span class="comment">// will replace previous pending action
+</span><span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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">add_fn</span><span class="special">,</span>
+ <span class="number">5</span><span class="special">,</span>
+ <span class="number">6</span><span class="special">),</span>
+ <span class="number">1</span><span class="special">);</span>
+</pre>
+</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 © 2008 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="channel.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="forkjoin.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/threadpool/libs/tp/doc/html/boost_threadpool/task.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/boost_threadpool/task.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,195 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Task</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="prev" href="pool.html" title="Pool">
+<link rel="next" href="this_task.html" title="Namespace this_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="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="this_task.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.task"></a><a class="link" href="task.html" title="Task"> Task</a>
+</h2></div></div></div>
+<p>
+ For each submitted action a new task object will be created and returned by
+ the pool. The <a class="link" href="task.html" title="Task"><span class="emphasis"><em>task</em></span></a>
+ object acts as a proxy for a result that is initially not known and gets evaluated
+ later by a worker thread. It transports the result (value or exception) of
+ the action back to the caller.
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">poolsize</span><span class="special">(</span> <span class="number">10</span><span class="special">)</span> <span class="special">);</span>
+
+<span class="comment">// task calculates fibonacci(10)
+</span><span class="comment">// scheduled in unbounded channel with FIFO ordering
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+<span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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="special">);</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">t</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="comment">// 55
+</span></pre>
+<a name="boost_threadpool.task.interruption"></a><h4>
+<a name="id370001"></a>
+ <a class="link" href="task.html#boost_threadpool.task.interruption">Interruption</a>
+ </h4>
+<p>
+ The returned <a class="link" href="task.html" title="Task"><span class="emphasis"><em>task</em></span></a>
+ object provides the possiblity to interrupt an action if it is cooperative.
+ An action is known as cooperative if it includes interruption points in its
+ code:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">join</span><span class="special">()</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">timed_join</span><span class="special">()</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable</span><span class="special">::</span><span class="identifier">wait</span><span class="special">()</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable</span><span class="special">::</span><span class="identifier">timed_wait</span><span class="special">()</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span><span class="special">::</span><span class="identifier">wait</span><span class="special">()</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable_any</span><span class="special">::</span><span class="identifier">timed_wait</span><span class="special">()</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">()</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep</span><span class="special">()</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">interruption_point</span><span class="special">()</span></code></li>
+</ul></div>
+<div class="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>
+ Interruption must not be disabled for the worker thread (class <span class="emphasis"><em>boost::this_thread::disable_interruption</em></span>).
+ </p></td></tr>
+</table></div>
+<p>
+ The action will be interrupted even if it is pending (interruption is remembered).
+ A <span class="emphasis"><em>boost::thread_interrupted</em></span> exception will be thrown by
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;::</span><span class="identifier">get</span><span class="special">()</span></code> if
+ the action was interrupted.
+</p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">poolsize</span><span class="special">(</span> <span class="number">10</span><span class="special">)</span> <span class="special">);</span>
+
+<span class="comment">// submit a long running task
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+ <span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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">long_running_fn</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+
+<span class="comment">// interrupt task
+</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">interrupt</span><span class="special">();</span>
+
+<span class="comment">// throws boost::thread_interrupted exception
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">t</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>
+</pre>
+<p>
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">poolsize</span><span class="special">(</span> <span class="number">10</span><span class="special">)</span> <span class="special">);</span>
+
+<span class="comment">// submit a long running task
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+ <span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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">long_running_fn</span><span class="special">)</span> <span class="special">)</span> <span class="special">);</span>
+
+<span class="comment">// interrupt task and wait for its termination
+</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">interrupt_and_wait</span><span class="special">();</span>
+
+<span class="comment">// throws boost::thread_interrupted exception
+</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">t</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>
+</pre>
+<a name="boost_threadpool.task.waiting_for_multiple_tasks"></a><h4>
+<a name="id371039"></a>
+ <a class="link" href="task.html#boost_threadpool.task.waiting_for_multiple_tasks">Waiting for
+ multiple tasks</a>
+ </h4>
+<p>
+ It is possible to wait for multiple tasks - <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">wait_for_all</span><span class="special">(</span><span class="identifier">tsk1</span><span class="special">,...,</span><span class="identifier">tskn</span><span class="special">)</span></code> blocks
+ until all n tasks are ready and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">wait_for_any</span><span class="special">(</span><span class="identifier">tsk1</span><span class="special">,...,</span><span class="identifier">tskn</span><span class="special">)</span></code> blocks
+ until at least one of the tasks becomes ready.
+ </p>
+<a name="boost_threadpool.task.exceptions_in_tasks"></a><h4>
+<a name="id371148"></a>
+ <a class="link" href="task.html#boost_threadpool.task.exceptions_in_tasks">Exceptions in tasks</a>
+ </h4>
+<p>
+ Exceptions thrown inside an action are transported by the associated task object.
+ Exceptions rethrown by type:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_cast</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_exception</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_typeid</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">domain_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">invalid_argument</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failure</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">length_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">logic_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">out_of_range</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">overflow_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">range_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">underflow_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">broken_promise</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">future_already_set</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">future_cancel</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">invalid_thread_argument</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">lock_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_exception</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_interrupted</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_permission_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">thread_resource_error</span></code></li>
+<li><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">unsupported_thread_option</span></code></li>
+</ul></div>
+<p>
+ Exceptions derived from <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span></code>
+ will be rethrown as <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code> in all other cases a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_exception</span></code>
+ is thrown.
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">pool</span><span class="special">&lt;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">unbounded_channel</span><span class="special">&lt;</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">fifo</span> <span class="special">&gt;</span>
+<span class="special">&gt;</span> <span class="identifier">pool</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">poolsize</span><span class="special">(</span> <span class="number">10</span><span class="special">)</span> <span class="special">);</span>
+
+<span class="comment">// task will throw an exception derived from std::exception
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tp</span><span class="special">::</span><span class="identifier">task</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</span> <span class="identifier">t</span><span class="special">(</span>
+ <span class="identifier">pool</span><span class="special">.</span><span class="identifier">submit</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">throwing_fn</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="identifier">t</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="comment">// will rethrow an std::runtime_error
+</span></pre>
+</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 © 2008 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="this_task.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/threadpool/libs/tp/doc/html/boost_threadpool/this_task.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/boost_threadpool/this_task.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,49 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Namespace this_task</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="prev" href="task.html" title="Task">
+<link rel="next" href="channel.html" title="Channel">
+</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="channel.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.this_task"></a><a class="link" href="this_task.html" title="Namespace this_task"> Namespace this_task</a>
+</h2></div></div></div>
+<p>
+ The __thread<span class="underline">pool</span>_ can be accessed via
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">this_task</span><span class="special">::</span><span class="identifier">get_thread_pool</span><span class="special">&lt;</span>
+ <span class="identifier">Pool</span> <span class="special">&gt;()</span></code>
+ ifthe calling code is executed by a worker thread.
+ </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 © 2008 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="channel.html"><img src="../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>

Added: sandbox/threadpool/libs/tp/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/html/index.html 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,153 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Chapter 1. Boost.Threadpool</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Threadpool">
+<link rel="next" href="boost_threadpool/pool.html" title="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="n" href="boost_threadpool/pool.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div>
+<div><h2 class="title">
+<a name="boost_threadpool"></a>Chapter 1. Boost.Threadpool</h2></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">Oliver</span> <span class="surname">Kowalke</span>
+</h3></div></div>
+<div><p class="copyright">Copyright © 2008 Oliver Kowalke</p></div>
+<div><div class="legalnotice">
+<a name="id358702"></a><p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></div>
+</div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section">Introduction</span></dt>
+<dt><span class="section"> Pool</span></dt>
+<dt><span class="section"> Task</span></dt>
+<dt><span class="section"> Namespace this_task</span></dt>
+<dt><span class="section"> Channel</span></dt>
+<dt><span class="section"> Scheduling</span></dt>
+<dt><span class="section"> Fork/Join</span></dt>
+<dt><span class="section"> Acknowledgements</span></dt>
+<dt><span class="section"> Reference</span></dt>
+<dd><dl>
+<dt><span class="section"> Class template pool</span></dt>
+<dt><span class="section"> Class template task</span></dt>
+<dt><span class="section"><a href="boost_threadpool/reference.html#boost_threadpool.reference.wait_for_all"> Non-member
+ function <code class="computeroutput"><span class="identifier">wait_for_all</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_threadpool/reference.html#boost_threadpool.reference.wait_for_any"> Non-member
+ function <code class="computeroutput"><span class="identifier">wait_for_any</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_threadpool/reference.html#boost_threadpool.reference.get_thread_pool"> Non-member
+ templated function <code class="computeroutput"><span class="identifier">get_thread_pool</span></code></a></span></dt>
+<dt><span class="section"> Class poolsize</span></dt>
+<dt><span class="section"> Class scanns</span></dt>
+<dt><span class="section"> Class high_watermark</span></dt>
+<dt><span class="section"> Class low_watermark</span></dt>
+<dt><span class="section"><a href="boost_threadpool/reference.html#boost_threadpool.reference.invalid_poolsize"> Class
+ <code class="computeroutput"><span class="identifier">invalid_poolsize</span></code></a></span></dt>
+<dt><span class="section"> Class invalid_scanns</span></dt>
+<dt><span class="section"><a href="boost_threadpool/reference.html#boost_threadpool.reference.invalid_timeduration"> Class
+ <code class="computeroutput"><span class="identifier">invalid_timeduration</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_threadpool/reference.html#boost_threadpool.reference.invalid_watermark"> Class
+ <code class="computeroutput"><span class="identifier">invalid_watermark</span></code></a></span></dt>
+<dt><span class="section"> Class task_rejected</span></dt>
+<dt><span class="section"><a href="boost_threadpool/reference.html#boost_threadpool.reference.has_priority"> Meta function
+ <code class="computeroutput"><span class="identifier">has_priority</span></code></a></span></dt>
+<dt><span class="section"><a href="boost_threadpool/reference.html#boost_threadpool.reference.priority_type"> Meta function
+ <code class="computeroutput"><span class="identifier">priority_type</span></code></a></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_threadpool.introduction"></a><a class="link" href="index.html#boost_threadpool.introduction" title="Introduction">Introduction</a>
+</h2></div></div></div>
+<p>
+ <span class="bold"><strong>Boost.Threadpool</strong></span> is designed for effectively
+ utilize the available hardware and provide a way for efficient asynchronous
+ processing of independent time consuming operations (actions) in the same process.
+ A thread pool contains a number of worker threads to perform actions in parallel,
+ which are usually managed by a scheduler. If a worker thread completes its
+ action, it will take the next action from the scheduler until all actions have
+ been completed. The worker thread then sleeps until there are new actions available.
+ Using a pool of worker threads over creating a new thread for each action may
+ result in better performance and better system stability because the overhead
+ for thread creation and destruction is negated.
+ </p>
+<p>
+ <span class="bold"><strong>Boost.Threadpool</strong></span> uses a <a class="link" href="boost_threadpool/pool.html#boost_threadpool.pool.work_stealing"><span class="emphasis"><em>work
+ stealing</em></span></a> algorithm and supports <a class="link" href="boost_threadpool/forkjoin.html" title="Fork/Join"><span class="emphasis"><em>fork/join</em></span></a>
+ parallelism (recursively splitting of actions into sub-actions that are solved
+ in parallel, waiting for them to complete, and then joining results).
+ </p>
+<p>
+ In order to use the classes and functions described here, you can either include
+ the specific headers specified by the descriptions of each class or function,
+ or include the master library header:
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tp</span><span class="special">/</span><span class="identifier">tp</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+</pre>
+<p>
+ which includes all the other headers in turn.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ <span class="bold"><strong>Boost.Threadpool</strong></span> uses the futures library,
+ N2561 C++0x proposal, from Anthony Williams (http://www.justsoftwaresolutions.co.uk/threading/updated-implementation-of-c++-futures-3.html)
+ as an implementation detail until boost has an official future library.
+ </p></td></tr>
+</table></div>
+<a name="boost_threadpool.introduction.tested_platforms"></a><h4>
+<a name="id326365"></a>
+ <a class="link" href="index.html#boost_threadpool.introduction.tested_platforms">Tested Platforms</a>
+ </h4>
+<p>
+ <span class="bold"><strong>Boost.Threadpool</strong></span> has been tested on the following
+ compilers/platforms:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ FreeBSD 7.0 (amd64), GCC 4.2.1
+ </li>
+<li>
+ Linux 2.6.26 (amd64), GCC 4.3.1
+ </li>
+<li>
+ Linux 2.6.23.9 (i386), GCC 4.2.4
+ </li>
+<li>
+ OpenSolaris/Nexenta 1.0.1 (amd64), GCC 4.2.1
+ </li>
+<li>
+ Windows XP Professional (i386), MSVC 9.0
+ </li>
+</ul></div>
+</div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: February 28, 2009 at 14:20:16 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="boost_threadpool/pool.html"><img src="../../doc/html/images/next.png" alt="Next"></a></div>
+</body>
+</html>

Modified: sandbox/threadpool/libs/tp/doc/reference.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/reference.qbk (original)
+++ sandbox/threadpool/libs/tp/doc/reference.qbk 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -10,7 +10,7 @@
 [include pool_ref.qbk]
 [include task_ref.qbk]
 [include wait_ref.qbk]
-[include reschedule_ref.qbk]
+[include this_task_ref.qbk]
 [include poolsize_ref.qbk]
 [include scanns_ref.qbk]
 [include watermark_ref.qbk]

Deleted: sandbox/threadpool/libs/tp/doc/reschedule_ref.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/reschedule_ref.qbk 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
+++ (empty file)
@@ -1,20 +0,0 @@
-[/
- (C) Copyright 2008 Oliver Kowalke.
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-]
-
-[section:reschedule_until Non-member function `reschedule_until`]
-
- #include <boost/tp/pool.hpp>
-
- void reschedule_until( function< bool() > const& cond);
-
-[variablelist
-[[Effects:] [Re-schedules current task until specified condition becomes true.]]
-[[Throws:] [Any exceptions that might be thrown by the condition.]]
-[[Note:] [This function resides in namespace `boost::this_task`.]]
-]
-
-[endsect]

Modified: sandbox/threadpool/libs/tp/doc/this_task.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/this_task.qbk (original)
+++ sandbox/threadpool/libs/tp/doc/this_task.qbk 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -6,8 +6,6 @@
 ]
 
 [section:this_task Namespace this_task]
-In the function `boost::this_task::reschedule_until( boost::function< bool() > const&)` allows to synchronize the task with other
-asynchronous events without blocking the __worker_threads__. The function accepts a function object
-which returning true if the synchronization happend. The task will be rescheduled until the condition becomes true.
+The pool can be accessed via `boost::this_task::get_thread_pool< Pool >()` ifthe calling code is executed by a __worker_thread__.
 
 [endsect]

Added: sandbox/threadpool/libs/tp/doc/this_task_ref.qbk
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/this_task_ref.qbk 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -0,0 +1,21 @@
+[/
+ (C) Copyright 2008 Oliver Kowalke.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+]
+
+[section:get_thread_pool Non-member function `get_thread_pool`]
+
+ #include <boost/tp/pool.hpp>
+
+ template< typename Pool >
+ Pool & get_thread_pool();
+
+[variablelist
+[[Effects:] [Returns reference to the thread pool where the current worker thread is running.]
+[[Throws:] [Nothing.]]
+[[Note:] [This function resides in namespace `boost::this_task`.]]
+]
+
+[endsect]

Modified: sandbox/threadpool/libs/tp/doc/threadpool.xml
==============================================================================
--- sandbox/threadpool/libs/tp/doc/threadpool.xml (original)
+++ sandbox/threadpool/libs/tp/doc/threadpool.xml 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -1,7 +1,7 @@
 <?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_threadpool" name="Boost.Threadpool" dirname="boost_threadpool"
-last-revision="$Date: 2009/02/23 19:42:35 $" xmlns:xi="http://www.w3.org/2001/XInclude">
+last-revision="$Date: 2009/02/28 14:27:32 $" xmlns:xi="http://www.w3.org/2001/XInclude">
   <libraryinfo>
     <authorgroup>
     <author>
@@ -471,6 +471,24 @@
 <phrase role="comment">// throws boost::thread_interrupted exception
 </phrase><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">t</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>
 </programlisting>
+ <anchor id="boost_threadpool.task.waiting_for_multiple_tasks"/>
+ <bridgehead renderas="sect3">
+ <link linkend="boost_threadpool.task.waiting_for_multiple_tasks">Waiting for
+ multiple tasks</link>
+ </bridgehead>
+ <para>
+ It is possible to wait for multiple tasks - <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">tp</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">wait_for_all</phrase><phrase role="special">(</phrase><phrase
+ role="identifier">tsk1</phrase><phrase role="special">,...,</phrase><phrase
+ role="identifier">tskn</phrase><phrase role="special">)</phrase></code> blocks
+ until all n tasks are ready and <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">tp</phrase><phrase role="special">::</phrase><phrase
+ role="identifier">wait_for_any</phrase><phrase role="special">(</phrase><phrase
+ role="identifier">tsk1</phrase><phrase role="special">,...,</phrase><phrase
+ role="identifier">tskn</phrase><phrase role="special">)</phrase></code> blocks
+ until at least one of the tasks becomes ready.
+ </para>
     <anchor id="boost_threadpool.task.exceptions_in_tasks"/>
     <bridgehead renderas="sect3">
       <link linkend="boost_threadpool.task.exceptions_in_tasks">Exceptions in tasks</link>
@@ -600,6 +618,17 @@
 <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">t</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">// will rethrow an std::runtime_error
 </phrase></programlisting>
   </section>
+ <section id="boost_threadpool.this_task">
+ <title><link linkend="boost_threadpool.this_task"> Namespace this_task</link></title>
+ <para>
+ The pool can be accessed via <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">get_thread_pool</phrase><phrase
+ role="special">&lt;</phrase> <phrase role="identifier">Pool</phrase> <phrase
+ role="special">&gt;()</phrase></code> ifthe calling code is executed by a worker
+ thread.
+ </para>
+ </section>
   <section id="boost_threadpool.channel">
     <title><link linkend="boost_threadpool.channel"> Channel</link></title>
     <para>
@@ -828,6 +857,13 @@
 <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special">&lt;&lt;</phrase> <phrase role="identifier">t</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">// prints 55
 </phrase></programlisting>
   </section>
+ <section id="boost_threadpool.acknowledgement">
+ <title><link linkend="boost_threadpool.acknowledgement"> Acknowledgements</link></title>
+ <para>
+ I'd like to thank Vincente Botet for his comments on the implementation details
+ of the code and Anthony Williams and Braddock Gaskill for their future libraries.
+ </para>
+ </section>
   <section id="boost_threadpool.reference">
     <title><link linkend="boost_threadpool.reference"> Reference</link></title>
     <section id="boost_threadpool.reference.pool">
@@ -890,17 +926,6 @@
   <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">result_of</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">Act</phrase><phrase role="special">()</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase> <phrase role="special">&gt;</phrase> <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>
-
- <phrase role="keyword">template</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Act</phrase> <phrase role="special">&gt;</phrase>
- <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">result_of</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">Act</phrase><phrase role="special">()</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">timed_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">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">Act</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">Attr</phrase> <phrase role="special">&gt;</phrase>
- <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">result_of</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">Act</phrase><phrase role="special">()</phrase> <phrase role="special">&gt;::</phrase><phrase role="identifier">type</phrase> <phrase role="special">&gt;</phrase> <phrase role="identifier">timed_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>
- <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="special">};</phrase>
 </programlisting>
       <section id="boost_threadpool.reference.pool.constructor_unbounded_channel_hw">
@@ -1893,6 +1918,111 @@
         </variablelist>
       </section>
     </section>
+ <section id="boost_threadpool.reference.wait_for_all">
+ <title><link linkend="boost_threadpool.reference.wait_for_all"> Non-member
+ function <code><phrase role="identifier">wait_for_all</phrase></code></link></title>
+
+<programlisting> <phrase role="preprocessor">#include</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">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">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="keyword">void</phrase> <phrase role="identifier">wait_for_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;);</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">void</phrase> <phrase role="identifier">wait_for_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;);</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">void</phrase> <phrase role="identifier">wait_for_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;);</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">void</phrase> <phrase role="identifier">wait_for_all</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">&gt;</p
hrase> <phrase role="special">&amp;);</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ Waits until all specified tasks are ready.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Any exceptions that might be thrown by the actions.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_threadpool.reference.wait_for_any">
+ <title><link linkend="boost_threadpool.reference.wait_for_any"> Non-member
+ function <code><phrase role="identifier">wait_for_any</phrase></code></link></title>
+
+<programlisting> <phrase role="preprocessor">#include</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">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">T1</phrase><phrase role="special">,</phrase> <phrase role="keyword">typename</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="keyword">void</phrase> <phrase role="identifier">wait_for_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;);</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">void</phrase> <phrase role="identifier">wait_for_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;);</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">void</phrase> <phrase role="identifier">wait_for_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;);</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">void</phrase> <phrase role="identifier">wait_for_any</phrase><phrase role="special">(</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T1</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T2</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T3</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T4</phrase> <phrase role="special">&gt;</phrase> <phrase role="special">&amp;,</phrase> <phrase role="identifier">task</phrase><phrase role="special">&lt;</phrase> <phrase role="identifier">T5</phrase> <phrase role="special">&gt;</p
hrase> <phrase role="special">&amp;);</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ Waits until at leaste one of specified tasks is ready.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Throws:</term>
+ <listitem>
+ <para>
+ Any exceptions that might be thrown by the actions.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section id="boost_threadpool.reference.get_thread_pool">
+ <title><link linkend="boost_threadpool.reference.get_thread_pool"> Non-member
+ function <code><phrase role="identifier">get_thread_pool</phrase></code></link></title>
+
+<programlisting> <phrase role="preprocessor">#include</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">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">Pool</phrase> <phrase role="special">&gt;</phrase>
+<phrase role="identifier">Pool</phrase> <phrase role="special">&amp;</phrase> <phrase role="identifier">get_thread_pool</phrase><phrase role="special">();</phrase>
+</programlisting>
+ <variablelist>
+ <title></title> <varlistentry><term>Effects:</term>
+ <listitem>
+ <para>
+ Returns reference to the thread pool where the current worker thread
+ is running.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ [Throws:
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Nothing.
+ </para>
+ </listitem>
+ </varlistentry> <varlistentry><term>Note:</term>
+ <listitem>
+ <para>
+ This function resides in namespace <code><phrase role="identifier">boost</phrase><phrase
+ role="special">::</phrase><phrase role="identifier">this_task</phrase></code>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
     <section id="boost_threadpool.reference.poolsize">
       <title><link linkend="boost_threadpool.reference.poolsize"> Class <code><phrase
       role="identifier">poolsize</phrase></code></link></title>

Modified: sandbox/threadpool/libs/tp/doc/wait_ref.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/wait_ref.qbk (original)
+++ sandbox/threadpool/libs/tp/doc/wait_ref.qbk 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -9,17 +9,17 @@
 
     #include <boost/tp/task.hpp>
 
- template< typename Tsk1, typename Tsk2 >
- void wait_for_all( Tsk1 &, Tsk2 &);
+ template< typename T1, typename T2 >
+ void wait_for_all( task< T1 > &, task< T2 > &);
 
- template< typename Tsk1, typename Tsk2, typename Tsk3 >
- void wait_for_all( Tsk1 &, Tsk2 &, Tsk3 &);
+ template< typename T1, typename T2, typename T3 >
+ void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &);
 
- template< typename Tsk1, typename Tsk2, typename Tsk3, typename Tsk4 >
- void wait_for_all( Tsk1 &, Tsk2 &, Tsk3 &, Tsk4 &);
+ template< typename T1, typename T2, typename T3, typename T4 >
+ void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &);
 
- template< typename Tsk1, typename Tsk2, typename Tsk3, typename Tsk4, typename Tsk5 >
- void wait_for_all( Tsk1 &, Tsk2 &, Tsk3 &, Tsk4 &, Tsk5 &);
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ void wait_for_all( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &, task< T5 > &);
 
 [variablelist
 [[Effects:] [Waits until all specified tasks are ready.]]
@@ -33,17 +33,17 @@
 
     #include <boost/tp/task.hpp>
 
- template< typename Tsk1, typename Tsk2 >
- void wait_for_any( Tsk1 &, Tsk2 &);
+ template< typename T1, typename T2 >
+ void wait_for_any( task< T1 > &, task< T2 > &);
 
- template< typename Tsk1, typename Tsk2, typename Tsk3 >
- void wait_for_any( Tsk1 &, Tsk2 &, Tsk3 &);
+ template< typename T1, typename T2, typename T3 >
+ void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &);
 
- template< typename Tsk1, typename Tsk2, typename Tsk3, typename Tsk4 >
- void wait_for_any( Tsk1 &, Tsk2 &, Tsk3 &, Tsk4 &);
+ template< typename T1, typename T2, typename T3, typename T4 >
+ void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &);
 
- template< typename Tsk1, typename Tsk2, typename Tsk3, typename Tsk4, typename Tsk5 >
- void wait_for_any( Tsk1 &, Tsk2 &, Tsk3 &, Tsk4 &, Tsk5 &);
+ template< typename T1, typename T2, typename T3, typename T4, typename T5 >
+ void wait_for_any( task< T1 > &, task< T2 > &, task< T3 > &, task< T4 > &, task< T5 > &);
 
 [variablelist
 [[Effects:] [Waits until at leaste one of specified tasks is ready.]]

Modified: sandbox/threadpool/libs/tp/examples/fork_join.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/fork_join.cpp (original)
+++ sandbox/threadpool/libs/tp/examples/fork_join.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -19,8 +19,7 @@
 class fibo
 {
 private:
- pool_type & pool_;
- int offset_;
+ int offset_;
 
         int seq_( int n)
         {
@@ -34,13 +33,13 @@
                 else
                 {
                         tp::task< int > t1(
- pool_.submit(
+ boost::this_task::get_thread_pool< pool_type >().submit(
                                         boost::bind(
                                                 & fibo::par_,
                                                 boost::ref( * this),
                                                 n - 1) ) );
                         tp::task< int > t2(
- pool_.submit(
+ boost::this_task::get_thread_pool< pool_type >().submit(
                                         boost::bind(
                                                 & fibo::par_,
                                                 boost::ref( * this),
@@ -50,12 +49,8 @@
         }
 
 public:
- fibo(
- pool_type & pool,
- int offset)
- :
- pool_( pool),
- offset_( offset)
+ fibo( int offset)
+ : offset_( offset)
         {}
 
         int execute( int n)
@@ -70,7 +65,7 @@
         try
         {
                 pool_type pool( tp::poolsize( 3) );
- fibo fib( pool, 5);
+ fibo fib( 5);
                 std::vector< tp::task< int > > results;
                 results.reserve( 40);
 

Modified: sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp (original)
+++ sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -19,8 +19,7 @@
 class fibo
 {
 private:
- pool_type & pool_;
- int offset_;
+ int offset_;
 
         int seq_( int n)
         {
@@ -34,13 +33,13 @@
                 else
                 {
                         tp::task< int > t1(
- pool_.submit(
+ boost::this_task::get_thread_pool< pool_type >().submit(
                                         boost::bind(
                                                 & fibo::par_,
                                                 boost::ref( * this),
                                                 n - 1) ) );
                         tp::task< int > t2(
- pool_.submit(
+ boost::this_task::get_thread_pool< pool_type >().submit(
                                         boost::bind(
                                                 & fibo::par_,
                                                 boost::ref( * this),
@@ -50,12 +49,8 @@
         }
 
 public:
- fibo(
- pool_type & pool,
- int offset)
- :
- pool_( pool),
- offset_( offset)
+ fibo( int offset)
+ : offset_( offset)
         {}
 
         int execute( int n)
@@ -71,7 +66,7 @@
         {
                 // ! BOOST_BIND_WORKER_TO_PROCESSORS must be defined !
                 pool_type pool;
- fibo fib( pool, 5);
+ fibo fib( 5);
                 std::vector< tp::task< int > > results;
                 results.reserve( 40);
 

Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -101,7 +101,7 @@
                 bool thrown( false);
                 try
                 { t.get(); }
- catch ( std::exception const&)
+ catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -159,7 +159,7 @@
                 bool thrown( false);
                 try
                 { t.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -278,7 +278,7 @@
                 bool thrown( false);
                 try
                 { t.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }

Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -101,7 +101,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -159,7 +159,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -279,7 +279,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }

Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -104,7 +104,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -166,7 +166,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -293,7 +293,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }

Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -104,7 +104,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -166,7 +166,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -299,7 +299,7 @@
                 bool thrown( false);
                 try
                 { f.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }

Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -88,7 +88,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -140,7 +140,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -251,7 +251,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }

Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -88,7 +88,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -140,7 +140,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -251,7 +251,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }

Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -91,7 +91,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -147,7 +147,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -265,7 +265,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }

Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp (original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp 2009-02-28 09:38:25 EST (Sat, 28 Feb 2009)
@@ -91,7 +91,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -147,7 +147,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }
@@ -271,7 +271,7 @@
                 bool thrown( false);
                 try
                 { tsk.get(); }
- catch ( std::exception const&)
+ catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
         }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk