Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54926 - in sandbox/task: . libs/task libs/task/doc libs/task/doc/html
From: oliver.kowalke_at_[hidden]
Date: 2009-07-13 14:41:06


Author: olli
Date: 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
New Revision: 54926
URL: http://svn.boost.org/trac/boost/changeset/54926

Log:
* docu

Added:
   sandbox/task/boost.png (contents, props changed)
   sandbox/task/libs/task/doc/ref_as_sub_task.qbk (contents, props changed)
Removed:
   sandbox/task/libs/task/boost.png
   sandbox/task/libs/task/doc/html/
   sandbox/task/libs/task/doc/ref_asy_sub_task.qbk
Text files modified:
   sandbox/task/libs/task/doc/async_completion_token.qbk | 2 +-
   sandbox/task/libs/task/doc/boost_task.qbk | 10 +++++-----
   sandbox/task/libs/task/doc/execution_policy.qbk | 2 +-
   sandbox/task/libs/task/doc/fork_join.qbk | 12 ++++++------
   sandbox/task/libs/task/doc/handle.qbk | 4 ----
   sandbox/task/libs/task/doc/overview.qbk | 7 ++-----
   sandbox/task/libs/task/doc/task.qbk | 25 ++-----------------------
   sandbox/task/libs/task/doc/todo.qbk | 14 +++++++-------
   sandbox/task/libs/task/doc/user_defined_executor.qbk | 2 +-
   9 files changed, 25 insertions(+), 53 deletions(-)

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

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

Modified: sandbox/task/libs/task/doc/async_completion_token.qbk
==============================================================================
--- sandbox/task/libs/task/doc/async_completion_token.qbk (original)
+++ sandbox/task/libs/task/doc/async_completion_token.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -8,7 +8,7 @@
 
 [section:async_completion_token Asynchronous completion token]
 
-The __act__ dispatches processing actions (__tasks__) in response to the completion of asynchronous operations. __act__ uniquely identifies
+The __act__ dispatches processing tasks in response to the completion of asynchronous operations. __act__ uniquely identifies
 the task and state necessary to process the result of the operation [footnote see [@http://www.cs.wustl.edu/~schmidt/PDF/ACT.pdf 'Asynchronous Completion Token'], Douglas Schmidt].
 
 [include handle.qbk]

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-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -26,13 +26,13 @@
 [def __boost_future__ [@http://www.justsoftwaresolutions.co.uk/threading/updated-implementation-of-c++-futures-3.html [*Boost.Future]]]
 
 [template link_async[link_text] [link boost_task.async [link_text]]]
-[template link_channel[link_text] [link boost_task.pool.channel [link_text]]]
-[template link_forkjoin[link_text] [link boost_task.pool.forkjoin [link_text]]]
-[template link_handle[link_text] [link boost_task.handle [link_text]]]
+[template link_channel[link_text] [link boost_task.execution_policy.pool.channel [link_text]]]
+[template link_forkjoin[link_text] [link boost_task.execution_policy.pool.forkjoin [link_text]]]
+[template link_handle[link_text] [link boost_task.async_completion_token.handle [link_text]]]
 [template link_own_thread[link_text] [link boost_task.own_thread [link_text]]]
-[template link_pool[link_text] [link boost_task.pool [link_text]]]
+[template link_pool[link_text] [link boost_task.execution_policy.pool [link_text]]]
 [template link_task[link_text] [link boost_task.task [link_text]]]
-[template link_work_stealing[link_text] [link boost_task.pool.work_stealing [link_text]]]
+[template link_work_stealing[link_text] [link boost_task.execution_policy.pool.work_stealing [link_text]]]
 
 [def __shared_future__ `boost::shared_future`]
 [def __thread__ `boost::thread`]

Modified: sandbox/task/libs/task/doc/execution_policy.qbk
==============================================================================
--- sandbox/task/libs/task/doc/execution_policy.qbk (original)
+++ sandbox/task/libs/task/doc/execution_policy.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -11,7 +11,7 @@
 In contrast to synchronous methods asynchronous methods do not block the program flow when a time consuming operation is executed.
 The application continues executing the current context and when the result of the asynchronous method is required the __act__ can be used.
 
-A __ep__ describes how a __task__ gets asynchronously executed and provides a link_handle(__act__) to manage the __task__.
+A __ep__ describes how a __task__ gets asynchronously executed and provides a [link_handle __act__] to manage the __task__.
 
 [include own_thread.qbk]
 [include new_thread.qbk]

Modified: sandbox/task/libs/task/doc/fork_join.qbk
==============================================================================
--- sandbox/task/libs/task/doc/fork_join.qbk (original)
+++ sandbox/task/libs/task/doc/fork_join.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -31,18 +31,18 @@
                         // sub-task computes fibonacci(n-1)
                         h1 = boost::task::async(
                                 boost::task::make_task(
- parallel_fib,
- n - 1,
- cutof) );
+ parallel_fib,
+ n - 1,
+ cutof) );
 
                         // fork sub-task by moving the task
                         // ownership to the thread-pool
                         // sub-task computes fibonacci(n-2)
                         h2 = boost::task::async(
                                 boost::task::make_task(
- parallel_fib,
- n - 2,
- cutof) );
+ parallel_fib,
+ n - 2,
+ cutof) );
 
                         // join the results of both sub-tasks
                         // if one of the both sub-tasks is not ready

Modified: sandbox/task/libs/task/doc/handle.qbk
==============================================================================
--- sandbox/task/libs/task/doc/handle.qbk (original)
+++ sandbox/task/libs/task/doc/handle.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -8,10 +8,6 @@
 
 [section:handle Handle]
 
-The __act__ dispatches tasks in response to the completion of asynchronous operations. __act__ uniquely identifies
-the task and state necessary to process the result of the operation [footnote see [@http://www.cs.wustl.edu/~schmidt/PDF/ACT.pdf
-'Asynchronous Completion Token'], Douglas Schmidt].
-
 __handle__ represents an __act__. It will be returned by [link_async __fn_async__] and is associated with the submitted __task__.
 
 

Modified: sandbox/task/libs/task/doc/overview.qbk
==============================================================================
--- sandbox/task/libs/task/doc/overview.qbk (original)
+++ sandbox/task/libs/task/doc/overview.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -82,18 +82,15 @@
>
> pool( boost::task::poolsize( 5) );
 
- // create two tasks, computing fibonacci numbers
- boost::task< long > t1( fibonacci, 10);
- boost::task< long > t2( fibonacci, 5);
-
                 // execute tasks in thread-pool
                 // move tasks ownership to executor
                 boost::task::handle< long > h1(
                         boost::task::async(
- boost::move( t1),
+ boost::task::make_task( fibonacci, 10),
                                 pool);
                 boost::task::handle< long > h2(
                         boost::task::async(
+ boost::task::make_task( fibonacci, 5),
                                 boost::move( t2),
                                 pool);
 

Added: sandbox/task/libs/task/doc/ref_as_sub_task.qbk
==============================================================================
--- (empty file)
+++ sandbox/task/libs/task/doc/ref_as_sub_task.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -0,0 +1,32 @@
+[/
+ 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:as_sub_task Class `as_sub_task`]
+
+``
+ #include <boost/task/as_sub_task.hpp>
+
+ struct as_sub_task
+ {
+ template< typename R >
+ handle< R > operator()( task< R >);
+ };
+``
+
+[heading Member function `operator()( task< R >)`]
+
+ template< typename R >
+ handle< R > operator()( task< R > t)
+
+[variablelist
+[[Effects:] [moves task in a new thread or thread-pool and returns an handle associated with the task]]
+[[Throws:] [`boost::thread_resource_error`]]
+]
+
+
+[endsect]
\ No newline at end of file

Deleted: sandbox/task/libs/task/doc/ref_asy_sub_task.qbk
==============================================================================
--- sandbox/task/libs/task/doc/ref_asy_sub_task.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
+++ (empty file)
@@ -1,32 +0,0 @@
-[/
- 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:as_sub_task Class `as_sub_task`]
-
-``
- #include <boost/task/as_sub_task.hpp>
-
- struct as_sub_task
- {
- template< typename R >
- handle< R > operator()( task< R >);
- };
-``
-
-[heading Member function `operator()( task< R >)`]
-
- template< typename R >
- handle< R > operator()( task< R > t)
-
-[variablelist
-[[Effects:] [moves task in a new thread or thread-pool and returns an handle associated with the task]]
-[[Throws:] [`boost::thread_resource_error`]]
-]
-
-
-[endsect]
\ No newline at end of file

Modified: sandbox/task/libs/task/doc/task.qbk
==============================================================================
--- sandbox/task/libs/task/doc/task.qbk (original)
+++ sandbox/task/libs/task/doc/task.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -22,31 +22,10 @@
         t2 = boost::move( t1);
 ``
 
-__boost_task__ provides the helper function __make_task__ in order to create __task__.
-
-``
- void echo( std::string const& msg)
- { fprintf( stderr, "%s\n", msg.c_str() ); }
-
- void main()
- {
- // execute task asynchron
- // move task ownership to executor
- boost::task::handle< void > h(
- boost::task::async(
- boost::task::make_task( echo, "hello world"),
- boost::task::new_thread() ) );
-
- // wait for task completion
- std::cout << h.wait() << std::endl;
- }
-
-``
-
 
 [heading Creation]
 
-__tasks__ are created by passing free-functions or member-functions of objects and its arguments to the task-constructor.
+Tasks are created by passing free-functions or member-functions of objects and its arguments to the task-constructor.
 
 * create task from free-function with arguments:
 
@@ -81,7 +60,7 @@
         boost::task::task< std::string > t( y);
 ``
 
-__fn_make_task__ can be used too in order to create an __task__:
+Helper function __fn_make_task__ can be used too in order to create an __task__:
 
 ``
         // task computing fibonacci(10)

Modified: sandbox/task/libs/task/doc/todo.qbk
==============================================================================
--- sandbox/task/libs/task/doc/todo.qbk (original)
+++ sandbox/task/libs/task/doc/todo.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -8,6 +8,13 @@
 
 [section:todo Appendix A: Future development]
 
+[heading Optimizations]
+
+* finer-grained locking for bounded_channel and unbounded_channel using two-lock-queue
+
+* lock-free-queue with fifo ordering as channel
+
+
 [heading Dynamic thread-pool]
 
 * __dynamic_pool__ adds or removes __worker_threads__ from the __thread_pool__ depending on the work-load (undersubscription/
@@ -43,11 +50,4 @@
 __thread_pools__ without deadlocking the pool
 
 
-[heading Optimizations]
-
-* finer-grainer bounded_channel and unbounded_channel using two-lock-queue
-
-* lock-free-queue with fifo ordering as channel
-
-
 [endsect]

Modified: sandbox/task/libs/task/doc/user_defined_executor.qbk
==============================================================================
--- sandbox/task/libs/task/doc/user_defined_executor.qbk (original)
+++ sandbox/task/libs/task/doc/user_defined_executor.qbk 2009-07-13 14:41:05 EDT (Mon, 13 Jul 2009)
@@ -53,7 +53,7 @@
                         callable ca( ctx.get_callable( boost::move( t) ) );
 
                         // apply the callable to the executor == fiber-scheduler
- sched_.submit( fiber::fiber( ca) );
+ sched_.submit( ca);
 
                         // return the handle
                         return h;


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