Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54129 - in sandbox/task: . libs/task/examples
From: oliver.kowalke_at_[hidden]
Date: 2009-06-21 02:05:36


Author: olli
Date: 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
New Revision: 54129
URL: http://svn.boost.org/trac/boost/changeset/54129

Log:
* tests modified

Text files modified:
   sandbox/task/change.log | 1 +
   sandbox/task/libs/task/examples/bind_to_processors.cpp | 21 +++++++++------------
   sandbox/task/libs/task/examples/delay.cpp | 19 ++++++++-----------
   sandbox/task/libs/task/examples/fork_join.cpp | 21 +++++++++------------
   sandbox/task/libs/task/examples/interrupt.cpp | 5 +----
   sandbox/task/libs/task/examples/pending.cpp | 5 +----
   sandbox/task/libs/task/examples/priority.cpp | 15 +++------------
   sandbox/task/libs/task/examples/reschedule_until.cpp | 24 ++++++++----------------
   sandbox/task/libs/task/examples/shutdown_now.cpp | 5 +----
   sandbox/task/libs/task/examples/smart.cpp | 15 +++------------
   sandbox/task/libs/task/examples/submit.cpp | 22 +++++-----------------
   sandbox/task/libs/task/examples/yield.cpp | 19 +++++++------------
   12 files changed, 56 insertions(+), 116 deletions(-)

Modified: sandbox/task/change.log
==============================================================================
--- sandbox/task/change.log (original)
+++ sandbox/task/change.log 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -11,6 +11,7 @@
 - new function interrupt_all_worker() for static_pool< Channel > in order to interrupt all
   worker-threads without invalidating the pool
 - default_pool() removed because thread_resource_error exceptions thrown by static pool
+- support of processor-binding for FreeBSD 7.1 >
 - tests updated
 - examples updated
 - documentation updated

Modified: sandbox/task/libs/task/examples/bind_to_processors.cpp
==============================================================================
--- sandbox/task/libs/task/examples/bind_to_processors.cpp (original)
+++ sandbox/task/libs/task/examples/bind_to_processors.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -38,15 +38,13 @@
         {
                 BOOST_ASSERT( boost::this_task::runs_in_pool() );
                 tsk::task< int > t1(
- boost::bind(
- parallel_fib,
- n - 1,
- cutof) );
+ parallel_fib,
+ n - 1,
+ cutof);
                 tsk::task< int > t2(
- boost::bind(
- parallel_fib,
- n - 2,
- cutof) );
+ parallel_fib,
+ n - 2,
+ cutof);
                 tsk::handle< int > h1(
                         tsk::async( boost::move( t1), tsk::as_sub_task() ) );
                 tsk::handle< int > h2(
@@ -68,10 +66,9 @@
                 for ( int i = 0; i < 10; ++i)
                 {
                         tsk::task< int > t(
- boost::bind(
- & parallel_fib,
- i,
- 5) );
+ parallel_fib,
+ i,
+ 5);
                         results.push_back(
                                 tsk::async(
                                         boost::move( t),

Modified: sandbox/task/libs/task/examples/delay.cpp
==============================================================================
--- sandbox/task/libs/task/examples/delay.cpp (original)
+++ sandbox/task/libs/task/examples/delay.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -39,15 +39,13 @@
         {
                 BOOST_ASSERT( boost::this_task::runs_in_pool() );
                 tsk::task< int > t1(
- boost::bind(
- parallel_fib_,
- n - 1,
- cutof) );
+ parallel_fib_,
+ n - 1,
+ cutof);
                 tsk::task< int > t2(
- boost::bind(
- parallel_fib_,
- n - 2,
- cutof) );
+ parallel_fib_,
+ n - 2,
+ cutof);
                 tsk::handle< int > h1(
                         tsk::async( boost::move( t1), tsk::as_sub_task() ) );
                 tsk::handle< int > h2(
@@ -71,9 +69,8 @@
                 for ( int i = 0; i < 10; ++i)
                 {
                         tsk::task< void > t(
- boost::bind(
- & parallel_fib,
- i) );
+ & parallel_fib,
+ i);
                         tsk::async(
                                 boost::move( t),
                                 pool);

Modified: sandbox/task/libs/task/examples/fork_join.cpp
==============================================================================
--- sandbox/task/libs/task/examples/fork_join.cpp (original)
+++ sandbox/task/libs/task/examples/fork_join.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -34,15 +34,13 @@
         {
                 BOOST_ASSERT( boost::this_task::runs_in_pool() );
                 tsk::task< int > t1(
- boost::bind(
- parallel_fib,
- n - 1,
- cutof) );
+ parallel_fib,
+ n - 1,
+ cutof);
                 tsk::task< int > t2(
- boost::bind(
- parallel_fib,
- n - 2,
- cutof) );
+ parallel_fib,
+ n - 2,
+ cutof);
                 tsk::handle< int > h1(
                         tsk::async(
                                 boost::move( t1),
@@ -69,10 +67,9 @@
                 for ( int i = 0; i < 10; ++i)
                 {
                         tsk::task< int > t(
- boost::bind(
- & parallel_fib,
- i,
- 5) );
+ & parallel_fib,
+ i,
+ 5);
                         results.push_back(
                                 tsk::async(
                                         boost::move( t),

Modified: sandbox/task/libs/task/examples/interrupt.cpp
==============================================================================
--- sandbox/task/libs/task/examples/interrupt.cpp (original)
+++ sandbox/task/libs/task/examples/interrupt.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -47,10 +47,7 @@
                 pool_type pool( tsk::poolsize( 5) );
                 
                 tsk::task< void > t1( long_running_fn);
- tsk::task< int > t2(
- boost::bind(
- fibonacci_fn,
- 10) );
+ tsk::task< int > t2( fibonacci_fn, 10);
                 tsk::async(
                         boost::move( t1),
                         pool);

Modified: sandbox/task/libs/task/examples/pending.cpp
==============================================================================
--- sandbox/task/libs/task/examples/pending.cpp (original)
+++ sandbox/task/libs/task/examples/pending.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -51,10 +51,7 @@
                 tsk::async(
                         boost::move( t1),
                         pool);
- tsk::task< int > t2(
- boost::bind(
- fibonacci_fn,
- 10) );
+ tsk::task< int > t2( fibonacci_fn, 10);
                 tsk::handle< int > h(
                         tsk::async(
                                 boost::move( t2),

Modified: sandbox/task/libs/task/examples/priority.cpp
==============================================================================
--- sandbox/task/libs/task/examples/priority.cpp (original)
+++ sandbox/task/libs/task/examples/priority.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -34,18 +34,9 @@
> pool( tsk::poolsize( 1) );
 
                 tsk::task< void > t1( long_running_fn);
- tsk::task< void > t2(
- boost::bind(
- print_fn,
- "This") );
- tsk::task< void > t3(
- boost::bind(
- print_fn,
- "a text.\n") );
- tsk::task< void > t4(
- boost::bind(
- print_fn,
- " is ") );
+ tsk::task< void > t2( print_fn, "This");
+ tsk::task< void > t3( print_fn, "a text.\n");
+ tsk::task< void > t4( print_fn, " is ");
 
                 tsk::async(
                         boost::move( t1),

Modified: sandbox/task/libs/task/examples/reschedule_until.cpp
==============================================================================
--- sandbox/task/libs/task/examples/reschedule_until.cpp (original)
+++ sandbox/task/libs/task/examples/reschedule_until.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -58,15 +58,13 @@
         {
                 BOOST_ASSERT( boost::this_task::runs_in_pool() );
                 tsk::task< int > t1(
- boost::bind(
- parallel_fib_,
- n - 1,
- cutof) );
+ parallel_fib_,
+ n - 1,
+ cutof);
                 tsk::task< int > t2(
- boost::bind(
- parallel_fib_,
- n - 2,
- cutof) );
+ parallel_fib_,
+ n - 2,
+ cutof);
                 tsk::handle< int > h1(
                         tsk::async( boost::move( t1), tsk::as_sub_task() ) );
                 tsk::handle< int > h2(
@@ -151,10 +149,7 @@
                 int fd[2];
                 create_sockets( fd);
 
- tsk::task< void > t1(
- boost::bind(
- & do_read,
- fd[0]) );
+ tsk::task< void > t1( do_read, fd[0]);
 
                 tsk::async(
                         boost::move( t1),
@@ -165,10 +160,7 @@
 
                 for ( int i = 0; i < 10; ++i)
                 {
- tsk::task< void > t(
- boost::bind(
- & parallel_fib,
- i) );
+ tsk::task< void > t( parallel_fib, i);
                         tsk::async(
                                 boost::move( t),
                                 pool);

Modified: sandbox/task/libs/task/examples/shutdown_now.cpp
==============================================================================
--- sandbox/task/libs/task/examples/shutdown_now.cpp (original)
+++ sandbox/task/libs/task/examples/shutdown_now.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -44,10 +44,7 @@
                         tsk::unbounded_channel< tsk::fifo >
> pool( tsk::poolsize( 1) );
 
- tsk::task< int > t(
- boost::bind(
- fibonacci_fn,
- 10) );
+ tsk::task< int > t( fibonacci_fn, 10);
                                 
                 tsk::handle< int > h(
                         tsk::async(

Modified: sandbox/task/libs/task/examples/smart.cpp
==============================================================================
--- sandbox/task/libs/task/examples/smart.cpp (original)
+++ sandbox/task/libs/task/examples/smart.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -60,18 +60,9 @@
> pool( tsk::poolsize( 1) );
 
                 tsk::task< void > t1( long_running_fn);
- tsk::task< void > t2(
- boost::bind(
- fibonacci_fn,
- 0) );
- tsk::task< void > t3(
- boost::bind(
- fibonacci_fn,
- 1) );
- tsk::task< void > t4(
- boost::bind(
- fibonacci_fn,
- 10) );
+ tsk::task< void > t2( fibonacci_fn, 0);
+ tsk::task< void > t3( fibonacci_fn, 1);
+ tsk::task< void > t4( fibonacci_fn, 10);
 
                 tsk::async(
                         boost::move( t1),

Modified: sandbox/task/libs/task/examples/submit.cpp
==============================================================================
--- sandbox/task/libs/task/examples/submit.cpp (original)
+++ sandbox/task/libs/task/examples/submit.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -39,23 +39,11 @@
                         tsk::unbounded_channel< tsk::priority< int > >
> pool( tsk::poolsize( 3) );
                 
- tsk::task< int > t1(
- boost::bind(
- fibonacci_fn,
- 10) );
- tsk::task< int > t2(
- boost::bind(
- fibonacci_fn,
- 10) );
- tsk::task< int > t3(
- boost::bind(
- fibonacci_fn,
- 10) );
- tsk::task< int > t4(
- boost::bind(
- fibonacci_fn,
- 10) );
-
+ tsk::task< int > t1( fibonacci_fn, 10);
+ tsk::task< int > t2( fibonacci_fn, 10);
+ tsk::task< int > t3( fibonacci_fn, 10);
+ tsk::task< int > t4( fibonacci_fn, 10);
+
                 tsk::handle< int > h1(
                         tsk::async( boost::move( t1) ) );
                 tsk::handle< int > h2(

Modified: sandbox/task/libs/task/examples/yield.cpp
==============================================================================
--- sandbox/task/libs/task/examples/yield.cpp (original)
+++ sandbox/task/libs/task/examples/yield.cpp 2009-06-21 02:05:34 EDT (Sun, 21 Jun 2009)
@@ -43,15 +43,13 @@
         {
                 BOOST_ASSERT( boost::this_task::runs_in_pool() );
                 tsk::task< int > t1(
- boost::bind(
- parallel_fib_,
- n - 1,
- cutof) );
+ parallel_fib_,
+ n - 1,
+ cutof);
                 tsk::task< int > t2(
- boost::bind(
- parallel_fib_,
- n - 2,
- cutof) );
+ parallel_fib_,
+ n - 2,
+ cutof);
                 tsk::handle< int > h1(
                         tsk::async( boost::move( t1), tsk::as_sub_task() ) );
                 tsk::handle< int > h2(
@@ -74,10 +72,7 @@
 
                 for ( int i = 0; i < 10; ++i)
                 {
- tsk::task< void > t(
- boost::bind(
- & parallel_fib,
- i) );
+ tsk::task< void > t( parallel_fib, i);
                         tsk::async(
                                 boost::move( t),
                                 pool);


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