Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53407 - in sandbox/task: boost/task boost/task/detail libs/task/doc libs/task/src
From: oliver.kowalke_at_[hidden]
Date: 2009-05-29 14:49:11


Author: olli
Date: 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
New Revision: 53407
URL: http://svn.boost.org/trac/boost/changeset/53407

Log:
* documentation
* default initiaized handle doesn't block on interrupt_and_wait()

Added:
   sandbox/task/libs/task/doc/ref_async.qbk (contents, props changed)
   sandbox/task/libs/task/doc/ref_handle.qbk (contents, props changed)
   sandbox/task/libs/task/doc/ref_new_thread.qbk (contents, props changed)
   sandbox/task/libs/task/doc/ref_own_thread.qbk (contents, props changed)
   sandbox/task/libs/task/doc/ref_scanns.qbk (contents, props changed)
   sandbox/task/libs/task/doc/ref_utility.qbk (contents, props changed)
Text files modified:
   sandbox/task/boost/task/async.hpp | 6
   sandbox/task/boost/task/detail/interrupter.hpp | 11 +
   sandbox/task/boost/task/handle.hpp | 4
   sandbox/task/boost/task/task.hpp | 25 ++
   sandbox/task/libs/task/doc/boost_task.qbk | 4
   sandbox/task/libs/task/doc/meta_functions.qbk | 6
   sandbox/task/libs/task/doc/ref_exceptions.qbk | 104 ++++++------
   sandbox/task/libs/task/doc/ref_meta.qbk | 49 +++--
   sandbox/task/libs/task/doc/ref_poolsize.qbk | 37 ++--
   sandbox/task/libs/task/doc/ref_static_pool.qbk | 326 ++++++++++++++++++---------------------
   sandbox/task/libs/task/doc/ref_task.qbk | 146 ++++-------------
   sandbox/task/libs/task/doc/ref_watermark.qbk | 66 ++++---
   sandbox/task/libs/task/doc/reference.qbk | 8
   sandbox/task/libs/task/src/interrupter.cpp | 13 -
   14 files changed, 367 insertions(+), 438 deletions(-)

Modified: sandbox/task/boost/task/async.hpp
==============================================================================
--- sandbox/task/boost/task/async.hpp (original)
+++ sandbox/task/boost/task/async.hpp 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -97,9 +97,9 @@
         }
 };
 
-template< typename Fn, typename R >
-handle< R > async( Fn fn, task< R > t)
-{ return fn( t); }
+template< typename AE, typename R >
+handle< R > async( AE ae, task< R > t)
+{ return ae( t); }
 
 template< typename R, typename Channel >
 handle< R > async( static_pool< Channel > & pool, task< R > t)

Modified: sandbox/task/boost/task/detail/interrupter.hpp
==============================================================================
--- sandbox/task/boost/task/detail/interrupter.hpp (original)
+++ sandbox/task/boost/task/detail/interrupter.hpp 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -25,6 +25,13 @@
 {
 class BOOST_TASK_DECL interrupter
 {
+public:
+ enum setting
+ {
+ wait_for,
+ dont_wait
+ };
+
 private:
         class impl : private noncopyable
         {
@@ -38,7 +45,7 @@
                 void interrupt_();
 
         public:
- impl();
+ impl( setting);
 
                 ~impl();
 
@@ -66,7 +73,7 @@
         shared_ptr< impl > impl_;
 
 public:
- interrupter();
+ interrupter( setting = wait_for);
 
         void set( shared_ptr< thread > const& thrd);
 

Modified: sandbox/task/boost/task/handle.hpp
==============================================================================
--- sandbox/task/boost/task/handle.hpp (original)
+++ sandbox/task/boost/task/handle.hpp 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -71,7 +71,7 @@
 
 public:
         handle()
- : fut_(), intr_(), id_()
+ : fut_(), intr_( detail::interrupter::dont_wait), id_()
         {}
 
         const id get_id() const
@@ -193,7 +193,7 @@
 
 public:
         handle()
- : fut_(), intr_(), id_()
+ : fut_(), intr_( detail::interrupter::dont_wait), id_()
         {}
 
         const id get_id() const

Modified: sandbox/task/boost/task/task.hpp
==============================================================================
--- sandbox/task/boost/task/task.hpp (original)
+++ sandbox/task/boost/task/task.hpp 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -28,10 +28,16 @@
 namespace boost { namespace task
 {
 
+template< typename Channel >
+class static_pool;
+
 template< typename R >
 class task
 {
 private:
+ template< typename Channel >
+ friend class static_pool;
+
         struct impl
         {
                 promise< R > prom;
@@ -105,6 +111,10 @@
 
         shared_ptr< impl > impl_;
 
+ template< typename F >
+ void set_wait_callback( F const& f)
+ { impl_->prom.set_wait_callback( f); }
+
 public:
         template< typename Fn >
         task( Fn const& fn)
@@ -122,16 +132,15 @@
 
         void operator()() // throw()
         { ( * impl_)(); }
-
- template< typename F >
- void set_wait_callback( F const& f)
- { impl_->prom.set_wait_callback( f); }
 };
 
 template<>
 class task< void >
 {
 private:
+ template< typename Channel >
+ friend class static_pool;
+
         struct impl
         {
                 promise< void > prom;
@@ -208,6 +217,10 @@
 
         shared_ptr< impl > impl_;
 
+ template< typename F >
+ void set_wait_callback( F const& f)
+ { impl_->prom.set_wait_callback( f); }
+
 public:
         template< typename Fn >
         task( Fn const& fn)
@@ -225,10 +238,6 @@
 
         void operator()() // throw()
         { ( * impl_)(); }
-
- template< typename F >
- void set_wait_callback( F const& f)
- { impl_->prom.set_wait_callback( f); }
 };
 
 template< typename Fn >

Modified: sandbox/task/libs/task/doc/boost_task.qbk
==============================================================================
--- sandbox/task/libs/task/doc/boost_task.qbk (original)
+++ sandbox/task/libs/task/doc/boost_task.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -41,11 +41,12 @@
 [def __hardware_concurrency__ `boost::thread::hardware_concurrency()`]
 
 [def __as_sub_task__ `boost::task::as_sub_task`]
+[def __attribute_type__ `boost::task::attribute_type`]
 [def __bounded_channel__ `boost::task::bounded_channel`]
 [def __default_pool__ `boost::task::default_pool`]
 [def __dynamic_pool__ `boost::task::dynamic_pool`]
 [def __handle__ `boost::task::handle`]
-[def __hase_priority__ `boost::task::has_priority`]
+[def __has_attribute__ `boost::task::has_attribute`]
 [def __hwm__ `boost::task::high_watermark`]
 [def __id__ `boost::task::id`]
 [def __lwm__ `boost::task::low_watermark`]
@@ -53,7 +54,6 @@
 [def __own_thread__ `boost::task::own_thread`]
 [def __pool_size__ `boost::task::poolsize`]
 [def __priority__ `boost::task::priority`]
-[def __priority_type__ `boost::task::priority_type`]
 [def __replace_oldest__ `boost::task::replace_oldest`]
 [def __static_pool__ `boost::task::static_pool`]
 [def __system_time__ `boost::task::system_time`]

Modified: sandbox/task/libs/task/doc/meta_functions.qbk
==============================================================================
--- sandbox/task/libs/task/doc/meta_functions.qbk (original)
+++ sandbox/task/libs/task/doc/meta_functions.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -8,7 +8,7 @@
 
 [section:meta_functions Meta functions]
 
-If the __thread_pool__ supports priorities __hase_priority__ evaluates to `true` at compile-time. The type of the priority is determined by __priority_type__.
+If the __thread_pool__ supports attributes (like priorities) __hase_attribute__ evaluates to `true` at compile-time (derived from boost::mpl::bool_). The type of the attribute is determined by __attribute_type__.
 
 
 ``
@@ -17,8 +17,8 @@
                         boost::task::priority< int > > // pool with priority scheduling; integer as priority type
> pool_type;
 
- std::cout << std::boolalpha << boost::task::has_priority< pool_type >::value << "\n";
- std::cout << typeid( boost::task::priority_type< pool_type >::type).name() << std::endl;
+ std::cout << std::boolalpha << boost::task::has_attribute< pool_type >::value << "\n";
+ std::cout << typeid( boost::task::attribute_type< pool_type >::type).name() << std::endl;
 ``
 
 

Added: sandbox/task/libs/task/doc/ref_async.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/ref_async.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -0,0 +1,59 @@
+[/
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+
+[section::async Function `async()`]
+
+[section:async_default Templated non-member function `async( AE, task< R >)`]
+
+``
+ #include <boost/task/async.hpp>
+
+ template< typename AE, typename R >
+ handle< R > async( AE ae, task< R > t);
+``
+
+[variablelist
+[[Effects:] [executes task in an asyncrounous executer and returns a handle associated with the task]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:async_pool Templated non-member function `async( pool< Channel > &, task< R >)`]
+
+``
+ #include <boost/task/async.hpp>
+
+ template< typename R, typename Channel >
+ handle< R > async( pool< Channel > & ae, task< R > t);
+``
+
+[variablelist
+[[Effects:] [executes task in a thread-pool and returns a handle associated with the task]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:async_pool_attr Templated non-member function `async( pool< Channel > &, task< R >, Attr)`]
+
+``
+ #include <boost/task/async.hpp>
+
+ template< typename R, typename Channel, typename Attr >
+ handle< R > async( pool< Channel > & ae, task< R > t, Attr attr);
+``
+
+[variablelist
+[[Effects:] [executes atrributed task in a thread-pool and returns a handle associated with the task]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[endsect]

Modified: sandbox/task/libs/task/doc/ref_exceptions.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_exceptions.qbk (original)
+++ sandbox/task/libs/task/doc/ref_exceptions.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -1,27 +1,29 @@
 [/
- (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).
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
 ]
 
+
 [section:invalid_poolsize Class `invalid_poolsize`]
 
- #include <boost/tp/exceptions.hpp>
+``
+ #include <boost/task/exceptions.hpp>
 
- class invalid_poolsize
- : public std::invalid_argument
- {
- public:
- invalid_poolsize( std::string const& msg);
- };
+ class invalid_poolsize : public std::invalid_argument
+ {
+ public:
+ invalid_poolsize( std::string const& msg);
+ };
+``
 
 [section:constructor Constructor]
 
- invalid_poolsize( std::string const& msg);
+ invalid_poolsize( std::string const& msg);
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::invalid_poolsize` instance.]]
+[[Effects:] [Constructs a `boost::task::invalid_poolsize` instance.]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -31,21 +33,22 @@
 
 [section:invalid_scanns Class `invalid_scanns`]
 
- #include <boost/tp/exceptions.hpp>
+``
+ #include <boost/task/exceptions.hpp>
 
- class invalid_scanns
- : public std::invalid_argument
- {
- public:
- invalid_scanns( std::string const& msg);
- };
+ class invalid_scanns : public std::invalid_argument
+ {
+ public:
+ invalid_scanns( std::string const& msg);
+ };
+``
 
 [section:constructor Constructor]
 
- invalid_scanns( std::string const& msg);
+ invalid_scanns( std::string const& msg)
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::invalid_scanns` instance.]]
+[[Effects:] [Constructs a `boost::task::invalid_scanns` instance.]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -55,21 +58,22 @@
 
 [section:invalid_timeduration Class `invalid_timeduration`]
 
- #include <boost/tp/exceptions.hpp>
+``
+ #include <boost/task/exceptions.hpp>
 
- class invalid_timeduration
- : public std::invalid_argument
- {
- public:
- invalid_timeduration( std::string const& msg);
- };
+ class invalid_timeduration : public std::invalid_argument
+ {
+ public:
+ invalid_timeduration( std::string const& msg);
+ };
+``
 
 [section:constructor Constructor]
 
- invalid_timeduration( std::string const& msg);
+ invalid_timeduration( std::string const& msg)
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::invalid_timeduration` instance.]]
+[[Effects:] [Constructs a `boost::task::invalid_timeduration` instance.]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -79,21 +83,22 @@
 
 [section:invalid_watermark Class `invalid_watermark`]
 
- #include <boost/tp/exceptions.hpp>
+``
+ #include <boost/task/exceptions.hpp>
 
- class invalid_watermark
- : public std::invalid_argument
- {
- public:
- invalid_watermark( std::string const& msg);
- };
+ class invalid_watermark : public std::invalid_argument
+ {
+ public:
+ invalid_watermark( std::string const& msg);
+ };
+``
 
 [section:constructor Constructor]
 
- invalid_watermark( std::string const& msg);
+ invalid_watermark( std::string const& msg)
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::invalid_watermark` instance.]]
+[[Effects:] [Constructs a `boost::task::invalid_watermark` instance.]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -103,21 +108,22 @@
 
 [section:task_rejected Class `task_rejected`]
 
- #include <boost/tp/exceptions.hpp>
+``
+ #include <boost/task/exceptions.hpp>
 
- class task_rejected
- : public std::runtime_error
- {
- public:
- task_rejected( std::string const& msg);
- };
+ class task_rejected : public std::runtime_error
+ {
+ public:
+ task_rejected( std::string const& msg);
+ };
+``
 
 [section:constructor Constructor]
 
- task_rejected( std::string const& msg);
+ task_rejected( std::string const& msg)
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::task_rejected` instance.]]
+[[Effects:] [Constructs a `boost::task::task_rejected` instance.]]
 [[Throws:] [Nothing]]
 ]
 [endsect]

Added: sandbox/task/libs/task/doc/ref_handle.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/ref_handle.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -0,0 +1,189 @@
+[/
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+[section:handle Class template `handle`]
+
+``
+ #include <boost/task/handle.hpp>
+
+ template< typename R >
+ class handle
+ {
+ handle();
+
+ const id get_id() const;
+
+ void interrupt();
+
+ void interrupt_and_wait();
+
+ void interrupt_and_wait_until( system_time const& abs_time);
+
+ template< typename Duration >
+ void interrupt_and_wait_for( Duration const& rel_time);
+
+ bool interruption_requested();
+
+ R get();
+
+ bool is_ready() const;
+
+ bool has_value() const;
+
+ bool has_exception() const;
+
+ void wait() const;
+
+ void swap( handle< R > & other);
+ };
+``
+
+[section:constructor Constructor]
+
+ handle()
+
+[variablelist
+[[Effects:] [constructs an empty (invalid) handle]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:get_id Member function `get_id()`]
+
+ const id get_id() const
+
+[variablelist
+[[Effects:] [returns identifier of the associated task]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:interruption_requested Member function `interruption_requested()`]
+
+ bool interruption_requested()
+
+[variablelist
+[[Effects:] [checks if interruption is already requested]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:interrupt Member function `interrupt()`]
+
+ void interrupt()
+
+[variablelist
+[[Effects:] [requests task interruption; doesn not block (immediatly returns)]]
+[[Throws:] [???]]
+]
+[endsect]
+
+
+[section:interrupt_and_wait Member function `interrupt_and_wait()`]
+
+ void interrupt_and_wait()
+
+[variablelist
+[[Effects:] [requests task interruption and blocks until worker-thread stops task]]
+[[Throws:] [???]]
+]
+[endsect]
+
+
+[section:interrupt_and_wait_until Member function `interrupt_and_wait_until()`]
+
+ void interrupt_and_wait_until( system_time const& abs_time)
+
+[variablelist
+[[Effects:] [requests task interruption and blocks until worker-thread stops task or time-point elapsed]]
+[[Throws:] [???]]
+]
+[endsect]
+
+
+[section:interrupt_and_wait_for Member function `interrupt_and_wait_for()`]
+
+ template< typename Duration >
+ void interrupt_and_wait_for( Duration const& rel_time)
+
+[variablelist
+[[Effects:] [requests task interruption and blocks until worker-thread stops task or time-duration elapsed]]
+[[Throws:] [???]]
+]
+[endsect]
+
+
+[section:get Member function `get()`]
+
+ R get()
+
+[variablelist
+[[Effects:] [requests the result]]
+[[Throws:] [task_interrupted, task_uninialized]]
+]
+[endsect]
+
+
+[section:wait Member function `wait()`]
+
+ void wait()
+
+[variablelist
+[[Effects:] [blocks caller until task is done]]
+[[Throws:] [task_interrupted, task_uninialized]]
+]
+[endsect]
+
+
+[section:is_ready Member function `is_ready()`]
+
+ bool is_ready()
+
+[variablelist
+[[Effects:] [checks if task is done]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:has_value Member function `has_value()`]
+
+ bool has_value()
+
+[variablelist
+[[Effects:] [checks if task is done and a result value is set]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:has_exception Member function `has_exception()`]
+
+ bool has_exception()
+
+[variablelist
+[[Effects:] [checks if task is done and an exception is set]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:swap Member function `swap()`]
+
+ void swap( handle< R > & other)
+
+[variablelist
+[[Effects:] [swapps handle]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[endsect]

Modified: sandbox/task/libs/task/doc/ref_meta.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_meta.qbk (original)
+++ sandbox/task/libs/task/doc/ref_meta.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -1,36 +1,39 @@
 [/
- (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).
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
 ]
 
-[section:has_priority Meta function `has_priority`]
 
- #include <boost/tp/info.hpp>
+[section:has_attribute Meta function `has_attribute`]
 
- template< typename Pool >
- struct has_priority
- :
- public mpl::bool_<
- is_same<
- detail::has_priority,
- typename Pool::scheduler_type::priority_tag_type
- >::value
- >
- {};
+``
+ #include <boost/task/meta.hpp>
+
+ template< typename Pool >
+ struct has_attribute : public mpl::bool_<
+ is_same<
+ detail::has_priority,
+ typename Pool::scheduler_type::priority_tag_type
+ >::value
+ >
+ {};
+``
 
 [endsect]
 
 
-[section:priority_type Meta function `priority_type`]
+[section:attribute_type Meta function `attribute_type`]
 
- #include <boost/tp/info.hpp>
+``
+ #include <boost/task/meta.hpp>
 
- template< typename Pool >
- struct priority_type
- {
- typedef typename Pool::scheduler_type::attribute_type type;
- };
+ template< typename Pool >
+ struct attribute_type
+ {
+ typedef typename Pool::scheduler_type::attribute_type type;
+ };
+``
 
 [endsect]

Added: sandbox/task/libs/task/doc/ref_new_thread.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/ref_new_thread.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -0,0 +1,33 @@
+[/
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+
+[section:new_thread Class `new_thread`]
+
+``
+ #include <boost/task/async.hpp>
+
+ struct new_thread
+ {
+ template< typename R >
+ handle< R > operator()( task< R > t);
+ };
+``
+
+[section:operator Member function `operator()( task< R > t)`]
+
+ template< typename R >
+ handle< R > operator()( task< R > t)
+
+[variablelist
+[[Effects:] [executes task in a new thread an returns an handle associated with the task]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[endsect]
\ No newline at end of file

Added: sandbox/task/libs/task/doc/ref_own_thread.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/ref_own_thread.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -0,0 +1,33 @@
+[/
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+
+[section:own_thread Class `own_thread`]
+
+``
+ #include <boost/task/async.hpp>
+
+ struct own_thread
+ {
+ template< typename R >
+ handle< R > operator()( task< R > t);
+ };
+``
+
+[section:operator Member function `operator()( task< R > t)`]
+
+ template< typename R >
+ handle< R > operator()( task< R > t)
+
+[variablelist
+[[Effects:] [executes task in the current thread an returns an handle associated with the task]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[endsect]
\ No newline at end of file

Modified: sandbox/task/libs/task/doc/ref_poolsize.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_poolsize.qbk (original)
+++ sandbox/task/libs/task/doc/ref_poolsize.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -1,41 +1,44 @@
 [/
- (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).
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
 ]
 
-[section:poolsize Class `poolsize`]
 
- #include <boost/tp/poolsize.hpp>
+[section:poolsize Class `poolsize`]
 
- class poolsize
- {
- public:
- explicit poolsize( std::size_t value);
+``
+ #include <boost/task/poolsize.hpp>
 
- operator std::size_t () const;
- };
+ class poolsize
+ {
+ public:
+ explicit poolsize( std::size_t value);
+
+ operator std::size_t () const;
+ };
+``
 
 [section:constructor Constructor]
 
- explicit poolsize( std::size_t value);
+ explicit poolsize( std::size_t value)
 
 [variablelist
 [[Preconditions:][value > 0]]
-[[Effects:] [Constructs a `boost::tp::poolsize` instance.]]
+[[Effects:] [constructs a `boost::task::poolsize` instance]]
 [[Postconditions:][operator std::size_t () > 0]]
-[[Throws:] [`boost::tp::invalid_poolsize`]]
+[[Throws:] [`boost::task::invalid_poolsize`]]
 ]
 [endsect]
 
 
 [section:operator Member function `operator std::size_t()`]
 
- operator std::size_t () const;
+ operator std::size_t () const
 
 [variablelist
-[[Effects:] [Returns pool size.]]
+[[Effects:] [returns the value]]
 [[Throws:] [Nothing]]
 ]
 [endsect]

Added: sandbox/task/libs/task/doc/ref_scanns.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/ref_scanns.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -0,0 +1,46 @@
+[/
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+
+[section:scanns Class `scanns`]
+
+``
+ #include <boost/task/scanns.hpp>
+
+ class scanns
+ {
+ public:
+ explicit scanns( std::size_t value);
+
+ operator std::size_t () const;
+ };
+``
+
+[section:constructor Constructor]
+
+ explicit scanns( std::size_t value)
+
+[variablelist
+[[Preconditions:][value > 0]]
+[[Effects:] [constructs a `boost::task::scanns` instance]]
+[[Postconditions:][operator std::size_t () > 0]]
+[[Throws:] [`boost::task::invalid_poolsize`]]
+]
+[endsect]
+
+
+[section:operator Member function `operator std::size_t()`]
+
+ operator std::size_t () const
+
+[variablelist
+[[Effects:] [returns the value]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+[endsect]

Modified: sandbox/task/libs/task/doc/ref_static_pool.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_static_pool.qbk (original)
+++ sandbox/task/libs/task/doc/ref_static_pool.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -1,145 +1,140 @@
 [/
- (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:pool Class template `pool`]
-
- #include <boost/tp/pool.hpp>
-
- template< typename Channel >
- class pool
- : private noncopyable
- {
- public:
- explicit pool(
- poolsize const& psize,
- posix_time::time_duration const& asleep = posix_time::microseconds( 10),
- scanns const& scns = scanns( 20) );
-
- explicit pool(
- poolsize const& psize,
- high_watermark const& hwm,
- low_watermark const& lwm,
- posix_time::time_duration const& asleep = posix_time::milliseconds( 100),
- scanns const& scns = scanns( 20) );
-
-
- explicit pool(
- posix_time::time_duration const& asleep = posix_time::microseconds( 10),
- scanns const& scns = scanns( 20) );
-
- explicit pool(
- high_watermark const& hwm,
- low_watermark const& lwm,
- posix_time::time_duration const& asleep = posix_time::milliseconds( 100),
- scanns const& scns = scanns( 20) );
-
- ~pool();
-
- std::size_t size();
- std::size_t active();
- std::size_t idle();
-
- void shutdown();
- const std::vector< callable > shutdown_now();
-
- bool closed();
- void clear();
- bool empty();
- std::size_t pending();
-
- const std::size_t upper_bound();
- void upper_bound( high_watermark const& hwm);
- const std::size_t lower_bound();
- void lower_bound( low_watermark const& lwm);
-
- template< typename Act >
- task< typename result_of< Act() >::type > submit( Act const& act);
-
- template< typename Act, typename Attr >
- task< typename result_of< Act() >::type > submit(
- Act const& act,
- Attr const& attr);
- };
-
- pool< unbounded_channel< fifo > > & get_default_pool();
-
- template< typename Act >
- task< R > launch_in_pool( Act const& act);
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+
+[section:static_pool Class template `static_pool`]
+
+``
+ #include <boost/task/static_pool.hpp>
+
+ template< typename Channel >
+ class static_pool : private noncopyable
+ {
+ public:
+ explicit pool(
+ poolsize const& psize,
+ posix_time::time_duration const& asleep = posix_time::microseconds( 10),
+ scanns const& scns = scanns( 20) );
+
+ explicit pool(
+ poolsize const& psize,
+ high_watermark const& hwm,
+ low_watermark const& lwm,
+ posix_time::time_duration const& asleep = posix_time::milliseconds( 100),
+ scanns const& scns = scanns( 20) );
+
+
+ explicit pool(
+ posix_time::time_duration const& asleep = posix_time::microseconds( 10),
+ scanns const& scns = scanns( 20) );
+
+ explicit pool(
+ high_watermark const& hwm,
+ low_watermark const& lwm,
+ posix_time::time_duration const& asleep = posix_time::milliseconds( 100),
+ scanns const& scns = scanns( 20) );
+
+ ~static_pool();
+
+ std::size_t size();
+ std::size_t active();
+ std::size_t idle();
+
+ void shutdown();
+ void shutdown_now();
+
+ bool closed();
+ void clear();
+ bool empty();
+ std::size_t pending();
+
+ const std::size_t upper_bound();
+ void upper_bound( high_watermark const& hwm);
+ const std::size_t lower_bound();
+ void lower_bound( low_watermark const& lwm);
+
+ template< typename R >
+ handle< R > submit( task< R > t);
+
+ template< typename R, typename Attr >
+ handle< R > submit( task< R > t, Attr const& attr);
+ };
+``
 
 [section:constructor_unbounded_channel_hw Constructor (unbounded channel)]
 
- explicit pool(
- posix_time::time_duration const& asleep = posix_time::microseconds( 10),
- scanns const& scns = scanns( 20) );
+ explicit static_pool(
+ posix_time::time_duration const& asleep = posix_time::microseconds( 10),
+ scanns const& scns = scanns( 20) )
 
 [variablelist
-[[Preconditions:] [Operating system provides functionality for processor pining.]]
-[[Effects:] [Constructs a `boost::tp::pool< Channel >` instance. For each processor a worker-thread is created and each worker-thread is pined exactly to one processor.]]
-[[Throws:] [`boost::tp::invalid_scanns`, `boost::tp::invalid_timeduration`]]
-[[Notes:] [Constructor has to be called if a __unbounded_channel__ is used.]]
+[[Preconditions:] [operating system provides functionality for processor pining]]
+[[Effects:] [constructs a pool - for each processor a worker-thread is created and bound to one processor - global-queue can queue an unlimited number of tasks]]
+[[Throws:] [`boost::task::invalid_scanns`, `boost::task::invalid_timeduration`]]
+[[Notes:] [constructor has to be called if a unbounded-channel is used]]
 ]
 [endsect]
 
 
 [section:constructor_unbounded_channel Constructor (unbounded channel)]
 
- explicit pool(
- poolsize const& psize,
- posix_time::time_duration const& asleep = posix_time::microseconds( 10),
- scanns const& scns = scanns( 20) );
+ explicit static_pool(
+ poolsize const& psize,
+ posix_time::time_duration const& asleep = posix_time::microseconds( 10),
+ scanns const& scns = scanns( 20) )
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::pool< Channel >` instance. Pool contains psize worker-threads.]]
-[[Throws:] [`boost::tp::invalid_scanns`, `boost::tp::invalid_timeduration`]]
-[[Notes:] [Constructor has to be called if a __unbounded_channel__ is used.]]
+[[Effects:] [constructs a pool containing psize worker-threads - global-queue can queue an unlimited number of tasks]]
+[[Throws:] [`boost::task::invalid_scanns`, `boost::task::invalid_timeduration`]]
+[[Notes:] [constructor has to be called if a unbounded-channel is used]]
 ]
 [endsect]
 
 
 [section:constructor_bounded_channel_hw Constructor (bounded channel)]
 
- explicit pool(
- high_watermark const& hwm,
- low_watermark const& lwm,
- posix_time::time_duration const& asleep = posix_time::milliseconds( 100),
- scanns const& scns = scanns( 20) );
+ explicit static_pool(
+ high_watermark const& hwm,
+ low_watermark const& lwm,
+ posix_time::time_duration const& asleep = posix_time::milliseconds( 100),
+ scanns const& scns = scanns( 20) )
 
 [variablelist
-[[Preconditions:] [Operating system provides functionality for processor pining.]]
-[[Effects:] [Constructs a `boost::tp::pool< Channel >` instance. For each processor a worker-thread is created and each worker-thread is pined exactly to one processor.]]
-[[Throws:] [`boost::tp::invalid_scanns`, `boost::tp::invalid_timeduration`, `boost::tp::invalid_watermark`]]
-[[Notes:] [Constructor has to be called if a __bounded_channel__ is used.]]
+[[Preconditions:] [operating system provides functionality for processor pining]]
+[[Effects:] [constructs a pool - for each processor a worker-thread is created and bound to one processor - global-queue can only queue a limited number of tasks]]
+[[Throws:] [`boost::task::invalid_scanns`, `boost::task::invalid_timeduration`, `boost::task::invalid_watermark`]]
+[[Notes:] [Constructor has to be called if a bounded-channel is used.]]
 ]
 [endsect]
 
 
 [section:constructor_bounded_channel Constructor (bounded channel)]
 
- explicit pool(
- poolsize const& psize,
- high_watermark const& hwm,
- low_watermark const& lwm,
- posix_time::time_duration const& asleep = posix_time::milliseconds( 100),
- scanns const& scns = scanns( 20) );
+ explicit static_pool(
+ poolsize const& psize,
+ high_watermark const& hwm,
+ low_watermark const& lwm,
+ posix_time::time_duration const& asleep = posix_time::milliseconds( 100),
+ scanns const& scns = scanns( 20) )
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::pool< Channel >` instance. Pool contains psize worker-threads.]]
-[[Throws:] [`boost::tp::invalid_scanns`, `boost::tp::invalid_timeduration`, `boost::tp::invalid_watermark`]]
-[[Notes:] [Constructor has to be called if a __bounded_channel__ is used.]]
+[[Effects:] [constructs a pool containing psize worker-threads - global-queue can only queue a limited number of tasks]]
+[[Throws:] [`boost::task::invalid_scanns`, `boost::task::invalid_timeduration`, `boost::task::invalid_watermark`]]
+[[Notes:] [constructor has to be called if a bounded-channel is used]]
 ]
 [endsect]
 
 
 [section:destructor Destructor]
 
- ~pool();
+ ~static_pool()
 
 [variablelist
-[[Effects:] [Calls `boost::tp::pool< Channel >::shutdown()` if not yet called.]]
+[[Effects:] [calls `:shutdown()` if not already called]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -147,10 +142,10 @@
 
 [section:size Member function `size()`]
 
- std::size_t size();
+ std::size_t size()
 
 [variablelist
-[[Effects:] [Returns how many worker threads are running in the pool.]]
+[[Effects:] [returns how many worker-threads are running in the pool]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -158,10 +153,10 @@
 
 [section:active Member function `active()`]
 
- std::size_t active();
+ std::size_t active()
 
 [variablelist
-[[Effects:] [Returns how many worker threads are active (executing an __action__).]]
+[[Effects:] [returns how many worker-threads are active (executing an task)]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -169,10 +164,10 @@
 
 [section:idle Member function `idle()`]
 
- std::size_t idle();
+ std::size_t idle()
 
 [variablelist
-[[Effects:] [Returns how many worker threads are idle (not executing an __action__).]]
+[[Effects:] [returns how many worker-threads are idle (not executing an task).]]
 [[Throws:] [Nothing]]
 [[Notes:] [The value is the difference of `size()` and `active()`]]
 ]
@@ -181,34 +176,34 @@
 
 [section:shutdown Member function `shutdown()`]
 
- void shutdown();
+ void shutdown()
 
 [variablelist
-[[Effects:] [Deactivates the channel and joins all worker threads. The pool is closed.]]
+[[Effects:] [deactivates the channel and joins all worker-threads - the pool is closed]]
 [[Throws:] [Nothing]]
-[[Notes:] [All pending __actions__ are processed.]]
+[[Notes:] [all pending tasks are processed]]
 ]
 [endsect]
 
 
 [section:shutdown_now Member function `shutdown_now()`]
 
- const std::vector< callable > shutdown_now();
+ void shutdown_now()
 
 [variablelist
-[[Effects:] [Deactivates the channel, send interruption request to all worker threads and joins them. The pool is closed.]]
+[[Effects:] [deactivates the channel, send interruption request to all worker-threads and joins them - the pool is closed]]
 [[Throws:] [Nothing]]
-[[Notes:] [Pending __actions__ are not processed but returned.]]
+[[Notes:] [pending tasks are not processed but returned]]
 ]
 [endsect]
 
 
 [section:losed Member function `closed()`]
 
- bool closed();
+ bool closed()
 
 [variablelist
-[[Effects:] [Queries if the pool is closed (pool is shutdown).]]
+[[Effects:] [queries if the pool is closed (pool is shutdown)]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -216,10 +211,10 @@
 
 [section:clear Member function `clear()`]
 
- void clear();
+ void clear()
 
 [variablelist
-[[Effects:] [Removes all pending __actions__ from the __channel__.]]
+[[Effects:] [removes all pending tasks from the channel]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -227,10 +222,10 @@
 
 [section:empty Member function `empty()`]
 
- bool empty();
+ bool empty()
 
 [variablelist
-[[Effects:] [Queries if the __channel__ is empty.]]
+[[Effects:] [queries if the channel is empty]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -238,10 +233,10 @@
 
 [section:pending Member function `pending()`]
 
- std::size_t pending();
+ std::size_t pending()
 
 [variablelist
-[[Effects:] [Queries how many __actions__ are pending in the __channel__.]]
+[[Effects:] [queries how many tasks are pending (still unprocessed) in the global-queue (channel)]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -249,103 +244,80 @@
 
 [section:get_upper_bound Member function `upper_bound()`]
 
- std::size_t upper_bound();
+ std::size_t upper_bound()
 
 [variablelist
-[[Preconditions:] [Channel is of type __bounded_channel__.]]
-[[Effects:] [Returns the upper bound of the __bounded_channel__.]]
+[[Preconditions:] [channel is of type bounded-channel]]
+[[Effects:] [returns the upper bound of the bounded-channel]]
 [[Throws:] [Nothing]]
-[[Notes:] [Can only be used if a __bounded_channel__ is used.]]
+[[Notes:] [can only be used if a bounded-channel is used]]
 ]
 [endsect]
 
 
 [section:set_upper_bound Member function `upper_bound( high_watermark const& hwm)`]
 
- void upper_bound( high_watermark const& hwm);
+ void upper_bound( high_watermark const& hwm)
 
 [variablelist
-[[Preconditions:] [Channel is of type __bounded_channel__.]]
-[[Effects:] [Sets the upper bound of the __bounded_channel__.]]
-[[Postconditions:] [`this->upper_bound() == hwm`.]]
-[[Throws:] [`boost::tp::invalid_watermark`]]
-[[Notes:] [Can only be used if a __bounded_channel__ is used.]]
+[[Preconditions:] [channel is of type bounded-channel]]
+[[Effects:] [sets the upper bound of the bounded-channel]]
+[[Postconditions:] [`this->upper_bound() == hwm`]]
+[[Throws:] [`boost::task::invalid_watermark`]]
+[[Notes:] [can only be used if a bounded-channel is used]]
 ]
 [endsect]
 
 
 [section:get_lower_bound Member function `lower_bound()`]
 
- std::size_t lower_bound();
+ std::size_t lower_bound();
 
 [variablelist
-[[Preconditions:] [Channel is of type __bounded_channel__.]]
-[[Effects:] [Returns the lower bound of the __bounded_channel__.]]
+[[Preconditions:] [channel is of type bounded-channel]]
+[[Effects:] [returns the lower bound of the bounded-channel]]
 [[Throws:] [Nothing]]
-[[Notes:] [Can only be used if a __bounded_channel__ is used.]]
+[[Notes:] [can only be used if a bounded-channel is used]]
 ]
 [endsect]
 
 
 [section:set_lower_bound Member function `lower_bound( low_watermark const& lwm)`]
 
- void lower_bound( low_watermark const& lwm);
+ void lower_bound( low_watermark const& lwm)
 
 [variablelist
-[[Preconditions:] [Channel is of type __bounded_channel__.]]
-[[Effects:] [Sets the lower bound of the __bounded_channel__.]]
-[[Postconditions:] [`this->lower_bound() == lwm`.]]
-[[Throws:] [`boost::tp::invalid_watermark`]]
-[[Notes:] [Can only be used if a __bounded_channel__ is used.]]
+[[Preconditions:] [channel is of type bounded-channel]]
+[[Effects:] [sets the lower bound of the bounded-channel]]
+[[Postconditions:] [`this->lower_bound() == lwm`]]
+[[Throws:] [`boost::task::invalid_watermark`]]
+[[Notes:] [can only be used if a bounded-channel is used]]
 ]
 [endsect]
 
 
 [section:submit Member function `submit( Act const& act)`]
 
- template< typename Act >
- task< typename result_of< Act() >::type > submit( Act const& act);
+ template< typename R >
+ handle< R > submit( task< R > const& t)
 
 [variablelist
-[[Preconditions:] [has_priority< pool >::value == false && ! closed()]]
-[[Effects:] [Submits an __action__ to the pool and returns a __task__ object.]]
-[[Throws:] [`boost::tp::task_rejected`]]
+[[Preconditions:] [has_attribute< pool >::value == false && ! closed()]]
+[[Effects:] [submits an task to the pool and returns an associated handle]]
+[[Throws:] [`boost::task::task_rejected`]]
 ]
 [endsect]
 
 
 [section:submit_attr Member function `submit( Act const& act, Attr const& attr)`]
 
- template< typename Act, typename Attr >
- task< typename result_of< Act() >::type > submit( Act const& act, Attr const& attr);
+ template< typename R, typename Attr >
+ handle< R > submit( task< R > const& t, Attr const& attr)
 
 [variablelist
-[[Preconditions:] [has_priority< pool >::value == true && ! closed()]]
-[[Effects:] [Submits an __action__ to the pool and returns a __task__ object. __Action__ is scheduled by the attribute.]]
-[[Throws:] [`boost::tp::task_rejected`]]
-]
-[endsect]
-
-
-[section:get_default_pool Non-member function `get_default_pool()`]
-
- pool< unbounded_channel< fifo > > & get_default_pool();
-
-[variablelist
-[[Effects:] [Get access to default thread pool (static).]]
-]
-[endsect]
-
-
-[section:launch_in_pool Non-member function `launch_in_pool( Act const& act)`]
-
- template< typename Act >
- task< R > launch_in_pool( Act const& act);
-
-[variablelist
-[[Preconditions:] [has_priority< pool >::value == false && ! closed()]]
-[[Effects:] [Submits an __action__ to the default pool and returns a __task__ object.]]
-[[Throws:] [`boost::tp::task_rejected`]]
+[[Preconditions:] [has_attribute< pool >::value == true && ! closed()]]
+[[Effects:] [submits an task to the pool and returns an associated handle - task is scheduled by the attribute]]
+[[Throws:] [`boost::task::task_rejected`]]
 ]
 [endsect]
 

Modified: sandbox/task/libs/task/doc/ref_task.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_task.qbk (original)
+++ sandbox/task/libs/task/doc/ref_task.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -1,162 +1,86 @@
 [/
- (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).
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
 ]
 
 [section:task Class template `task`]
 
- #include <boost/tp/task.hpp>
+``
+ #include <boost/task/task.hpp>
 
- template< typename R >
- class task
- {
- public:
- template< typename Pool >
- task(
- Pool * pool,
- future< R > const& fut,
- detail::interrupter const& intr);
-
- void interrupt();
- void interrupt_and_wait();
- void interrupt_and_wait( system_time const& abs_time);
- template< typename Duration >
- void interrupt_and_wait( Duration const& rel_time);
- bool interrupt_requested();
-
- R get() const;
-
- bool is_ready() const;
- bool has_value() const;
- bool has_exception() const;
-
- void wait() const;
- template< typename Duration >
- bool timed_wait( Duration const& rel_time) const;
- bool timed_wait_until( system_time const& abs_time) const;
- };
+ template< typename R >
+ class task
+ {
+ public:
+ template< typename Fn >
+ task( Fn const& fn);
 
-[section:constructor Constructor]
+ const id get_id() const;
 
- template< typename Pool >
- task(
- Pool * pool,
- future< R > const& fut,
- detail::interrupter const& intr);
+ shared_future< R > & get_future();
 
-[variablelist
-[[Effects:] [Constructs a `boost::tp::task< R >` instance.]]
-[[Throws:] [Nothing]]
-[[Notes:] [task objects should only be constructed by the pool.]]
-]
-[endsect]
+ void swap( task< R > & other) // throw();
 
+ void operator()() // throw();
+ }
+``
 
-[section:interrupt Member function `interrupt()`]
+[section:constructor Constructor]
 
- void interrupt();
+ template< typename Fn >
+ task( Fn const& fn)
 
 [variablelist
-[[Effects:] [Associated __action__ will be interrupted the next time it enters a __interruption_point__ if interruption is not disabled. The function returns immediatly.]]
+[[Effects:] [constructs a `boost::tp::task< R >` from a function object]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
 
 
-[section:interrupt_and_wait Member function `interrupt_and_wait()`]
-
- void interrupt_and_wait();
-
- void interrupt_and_wait( system_time const& abs_time);
+[section:get_id Member function `get_id()`]
 
- template< typename DurationTime >
- void interrupt_and_wait( DurationTime const& rel_time);
+ const id get_id() const
 
 [variablelist
-[[Effects:] [Associated __action__ will be interrupted the next time it enters one __interruption_point__ if interruption is not disabled. The function waits until the __action__ has terminated or the specified duration td has elapsed.]]
+[[Effects:] [returns task identifier]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
 
 
-[section:get Member function `get()`]
+[section:get_future Member function `get_future()`]
 
- R get() const;
+ shared_future< R > & get_future()
 
 [variablelist
-[[Effects:] [Returns fulfilled value or throws fulfilled exception.]]
-[[Throws:] [`boost::future::broken_promise`]]
+[[Effects:] [returns a future assiciated with the task]]
+[[Throws:] [???]]
 ]
 [endsect]
 
 
-[section:is_read Member function `is_ready()`]
+[section:swap Member function `swap()`]
 
- bool is_ready() const;
+ void swap( task< R > & other)
 
 [variablelist
-[[Effects:] [Queries if the __action__ has been fulfilled.]]
+[[Effects:] [swaps the task]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
 
 
-[section:has_value Member function `has_value()`]
+[section:operator() Member function `operator()()`]
 
- bool has_value() const;
+ void operator()()
 
 [variablelist
-[[Effects:] [Queries if the __action__ has been fulfilled (is ready) and has a value.]]
+[[Effects:] [executes tasks internal function object]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
 
 
-[section:has_exception Member function `has_exception()`]
-
- bool has_exception() const;
-
-[variablelist
-[[Effects:] [Queries if the __action__ has been fulfilled (is ready) and has an exception.]]
-[[Throws:] [Nothing]]
-]
-[endsect]
-
-
-[section:wait Member function `wait()`]
-
- void wait() const;
-
-[variablelist
-[[Effects:] [Waits until the result is ready.]]
-[[Throws:] [Throws thread_interrupted if the result is not ready at the point of the call, and the current thread is interrupted.]]
-]
-[endsect]
-
-
-[section:timed_wait Member function `timed_wait()`]
-
- template< typename Duration >
- bool timed_wait( Duration const& wait_duration);
-
-[variablelist
-[[Effects:] [Waits until the result is ready, or returns false if the time specified by wait_duration has elapsed.]]
-[[Throws:] [Throws thread_interrupted if the result is not ready at the point of the call, and the current thread is interrupted.]]
-]
-[endsect]
-
-
-[section:timed_wait_until Member function `timed_wait_until()`]
-
- bool timed_wait_until( system_time const& wait_timeout);
-
-[variablelist
-[[Effects:] [Waits until the result is ready, or returns false if the time point specified by wait_timeout has passed.]]
-[[Throws:] [Throws thread_interrupted if the result is not ready at the point of the call, and the current thread is interrupted.]]
-]
-[endsect]
-
-
 [endsect]

Added: sandbox/task/libs/task/doc/ref_utility.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/ref_utility.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -0,0 +1,135 @@
+[/
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
+]
+
+
+[section:utility Utilities]
+
+[section:reschedule_until Non-member function `reschedule_until()`]
+
+``
+ #include <boost/task/utility.hpp>
+
+ template< typename Pred >
+ void reschedule_until( Pred const&)
+``
+
+[variablelist
+[[Effects:] [reschedules current task until passed callable predicate becomes ready]
+[[Throws:] [Nothing.]]
+[[Note:] [This function resides in namespace `boost::this_task`.]]
+]
+
+[endsect]
+
+
+[section:get_pool Non-member function `get_pool()`]
+
+``
+ #include <boost/task/utility.hpp>
+
+ template< typename Pool >
+ Pool & get_pool()
+``
+
+[variablelist
+[[Effects:] [returns reference to the thread-pool where the current worker thread is executed]
+[[Throws:] [Nothing.]]
+[[Note:] [This function resides in namespace `boost::this_task`.]]
+]
+
+[endsect]
+
+
+[section:runs_in_pool Non-member function `runs_in_pool()`]
+
+``
+ #include <boost/task/utility.hpp>
+
+ bool runs_in_pool()
+``
+
+[variablelist
+[[Effects:] [returns true if the current task is executed in a thread-pool]
+[[Throws:] [Nothing.]]
+[[Note:] [This function resides in namespace `boost::this_task`.]]
+]
+
+[endsect]
+
+
+[section:worker_id Non-member function `worker_id()`]
+
+``
+ #include <boost/task/utility.hpp>
+
+ id worker_id()
+``
+
+[variablelist
+[[Effects:] [returns returns the thread-id of the worker-thread]
+[[Throws:] [Nothing.]]
+[[Note:] [This function resides in namespace `boost::this_task`.]]
+]
+
+[endsect]
+
+
+[section:delay Non-member function `delay()`]
+
+``
+ #include <boost/task/utility.hpp>
+
+ void delay( system_time abs_time)
+
+ template< typename Duration >
+ void delay( Duration const& rel_time)
+``
+
+[variablelist
+[[Effects:] [delays the execution of the current task so that the worker-thread can process another task in the meantime]
+[[Throws:] [Nothing.]]
+[[Note:] [This function resides in namespace `boost::this_task`.]]
+]
+
+[endsect]
+
+
+[section:yield Non-member function `yield()`]
+
+``
+ #include <boost/task/utility.hpp>
+
+ void yield()
+``
+
+[variablelist
+[[Effects:] [yields the current task so that the worker-threadcan process another task in the meantime]
+[[Throws:] [Nothing.]]
+[[Note:] [This function resides in namespace `boost::this_task`.]]
+]
+
+[endsect]
+
+
+[section:interrupt Non-member function `interrupt()`]
+
+``
+ #include <boost/task/utility.hpp>
+
+ void interrupt()
+``
+
+[variablelist
+[[Effects:] [task can request interruption for itself]
+[[Throws:] [Nothing.]]
+[[Note:] [This function resides in namespace `boost::this_task`.]]
+]
+
+[endsect]
+
+
+[endsect]

Modified: sandbox/task/libs/task/doc/ref_watermark.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_watermark.qbk (original)
+++ sandbox/task/libs/task/doc/ref_watermark.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -1,38 +1,41 @@
 [/
- (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).
+ Copyright Oliver Kowalke 2009.
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt
 ]
 
-[section:high_watermark Class `high_watermark`]
 
- #include <boost/tp/watermark.hpp>
+[section:high_watermark Class `high_watermark`]
 
- class high_watermark
- {
- public:
- explicit high_watermark( std::size_t value);
+``
+ #include <boost/task/watermark.hpp>
 
- operator std::size_t () const;
- };
+ class high_watermark
+ {
+ public:
+ explicit high_watermark( std::size_t value);
+
+ operator std::size_t () const;
+ };
+``
 
 [section:constructor Constructor]
 
- explicit high_watermark( std::size_t value);
+ explicit high_watermark( std::size_t value)
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::high_watermark` instance.]]
-[[Throws:] [`boost::tp::invalid_watermark`]]
+[[Effects:] [constructs a `boost::tp::high_watermark` instance]]
+[[Throws:] [`boost::task::invalid_watermark`]]
 ]
 [endsect]
 
 [section:operator Member function `operator std::size_t()`]
 
- operator std::size_t () const;
+ operator std::size_t () const
 
 [variablelist
-[[Effects:] [Returns high watermark.]]
+[[Effects:] [returns high watermark]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
@@ -42,34 +45,37 @@
 
 [section:low_watermark Class `low_watermark`]
 
- #include <boost/tp/watermark.hpp>
+``
+ #include <boost/task/watermark.hpp>
 
- class low_watermark
- {
- public:
- explicit low_watermark( std::size_t value);
-
- operator std::size_t () const;
- };
+ class low_watermark
+ {
+ public:
+ explicit low_watermark( std::size_t value);
+
+ operator std::size_t () const;
+ };
+``
 
 [section:constructor Constructor]
 
- explicit low_watermark( std::size_t value);
+ explicit low_watermark( std::size_t value)
 
 [variablelist
-[[Effects:] [Constructs a `boost::tp::low_watermark` instance.]]
-[[Throws:] [`boost::tp::invalid_watermark`]]
+[[Effects:] [constructs a `boost::task::low_watermark` instance]]
+[[Throws:] [`boost::task::invalid_watermark`]]
 ]
 [endsect]
 
 [section:operator Member function `operator std::size_t()`]
 
- operator std::size_t () const;
+ operator std::size_t () const
 
 [variablelist
-[[Effects:] [Returns low watermark.]]
+[[Effects:] [returns low watermark]]
 [[Throws:] [Nothing]]
 ]
 [endsect]
 
+
 [endsect]
\ No newline at end of file

Modified: sandbox/task/libs/task/doc/reference.qbk
==============================================================================
--- sandbox/task/libs/task/doc/reference.qbk (original)
+++ sandbox/task/libs/task/doc/reference.qbk 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -11,11 +11,15 @@
 [include ref_task.qbk]
 [include ref_handle.qbk]
 [include ref_async.qbk]
+[include ref_own_thread.qbk]
+[include ref_new_thread.qbk]
 [include ref_static_pool.qbk]
-[include ref_utilities.qbk]
-[include ref_meta_functions.qbk]
+[include ref_utility.qbk]
+[include ref_meta.qbk]
 [include ref_exceptions.qbk]
+[include ref_poolsize.qbk]
 [include ref_watermark.qbk]
+[include ref_scanns.qbk]
 
 
 [endsect]

Modified: sandbox/task/libs/task/src/interrupter.cpp
==============================================================================
--- sandbox/task/libs/task/src/interrupter.cpp (original)
+++ sandbox/task/libs/task/src/interrupter.cpp 2009-05-29 14:49:07 EDT (Fri, 29 May 2009)
@@ -22,14 +22,14 @@
         }
 }
 
-interrupter::impl::impl()
+interrupter::impl::impl( setting s)
 :
 interruption_requested_( false),
 done_( false),
 cond_(),
 mtx_(),
 thrd_()
-{}
+{ if ( s == dont_wait) reset(); }
 
 interrupter::impl::~impl()
 { reset(); }
@@ -48,11 +48,6 @@
 interrupter::impl::reset()
 {
         unique_lock< mutex > lk( mtx_);
-// BOOST_ASSERT( thrd_);
-// try
-// { thrd_.reset(); }
-// catch (...)
-// { printf("exception\n"); }
         try
         { this_thread::interruption_point(); }
         catch ( thread_interrupted const&)
@@ -94,8 +89,8 @@
         return interruption_requested_;
 }
 
-interrupter::interrupter()
-: impl_( new impl() )
+interrupter::interrupter( setting s)
+: impl_( new impl( s) )
 {}
 
 void


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