Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51478 - in sandbox/threadpool/libs/tp: doc examples
From: oliver.kowalke_at_[hidden]
Date: 2009-02-27 16:53:56


Author: olli
Date: 2009-02-27 16:53:55 EST (Fri, 27 Feb 2009)
New Revision: 51478
URL: http://svn.boost.org/trac/boost/changeset/51478

Log:
* documentation for this_task and wait functions

Added:
   sandbox/threadpool/libs/tp/doc/acknowledgement.qbk (contents, props changed)
   sandbox/threadpool/libs/tp/doc/this_task.qbk (contents, props changed)
Text files modified:
   sandbox/threadpool/libs/tp/doc/task.qbk | 3 +++
   sandbox/threadpool/libs/tp/doc/threadpool.qbk | 2 ++
   sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp | 2 +-
   3 files changed, 6 insertions(+), 1 deletions(-)

Added: sandbox/threadpool/libs/tp/doc/acknowledgement.qbk
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/acknowledgement.qbk 2009-02-27 16:53:55 EST (Fri, 27 Feb 2009)
@@ -0,0 +1,11 @@
+[/
+ (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:acknowledgement Acknowledgements]
+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.
+[endsect]

Modified: sandbox/threadpool/libs/tp/doc/task.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/task.qbk (original)
+++ sandbox/threadpool/libs/tp/doc/task.qbk 2009-02-27 16:53:55 EST (Fri, 27 Feb 2009)
@@ -76,6 +76,9 @@
     // throws boost::thread_interrupted exception
     std::cout << t.get() << std::endl;
 
+[heading Waiting for multiple tasks]
+It is possible to wait for multiple tasks - `boost::tp::wait_for_all(tsk1,...,tskn)` blocks until all n tasks are ready and
+`boost::tp::wait_for_any(tsk1,...,tskn)` blocks until at least one of the task becomes ready..
 
 [heading Exceptions in tasks]
 Exceptions thrown inside an __action__ are transported by the associated task object.

Added: sandbox/threadpool/libs/tp/doc/this_task.qbk
==============================================================================
--- (empty file)
+++ sandbox/threadpool/libs/tp/doc/this_task.qbk 2009-02-27 16:53:55 EST (Fri, 27 Feb 2009)
@@ -0,0 +1,14 @@
+[/
+ (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: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 returns an boolean from `operator()()` indicating if the synchronization happend.
+The task will be rescheduled until the condition becomes true.
+
+[endsect]

Modified: sandbox/threadpool/libs/tp/doc/threadpool.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/threadpool.qbk (original)
+++ sandbox/threadpool/libs/tp/doc/threadpool.qbk 2009-02-27 16:53:55 EST (Fri, 27 Feb 2009)
@@ -51,7 +51,9 @@
 [include introduction.qbk]
 [include pool.qbk]
 [include task.qbk]
+[include this_task.qbk]
 [include channel.qbk]
 [include scheduling.qbk]
 [include forkjoin.qbk]
+[include acknowledgement.qbk]
 [include reference.qbk]

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-27 16:53:55 EST (Fri, 27 Feb 2009)
@@ -1,4 +1,4 @@
-##include <iostream>
+#include <iostream>
 #include <cstdlib>
 #include <stdexcept>
 #include <vector>


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