Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50582 - sandbox/interthreads/boost/interthreads/algorithm
From: vicente.botet_at_[hidden]
Date: 2009-01-14 12:30:14


Author: viboes
Date: 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
New Revision: 50582
URL: http://svn.boost.org/trac/boost/changeset/50582

Log:
interthreads version 0.2
Adding threader/joiner
Adding Asynchronous Executors fmk
Text files modified:
   sandbox/interthreads/boost/interthreads/algorithm/detach_all.hpp | 2
   sandbox/interthreads/boost/interthreads/algorithm/get_all.hpp | 55 ++++++++++++++++++++++++++++++++-------
   sandbox/interthreads/boost/interthreads/algorithm/get_all_until.hpp | 2
   sandbox/interthreads/boost/interthreads/algorithm/interrupt_all.hpp | 2
   sandbox/interthreads/boost/interthreads/algorithm/interruption_requested_on_all.hpp | 2
   sandbox/interthreads/boost/interthreads/algorithm/join_all.hpp | 2
   sandbox/interthreads/boost/interthreads/algorithm/join_all_until.hpp | 2
   sandbox/interthreads/boost/interthreads/algorithm/wait_all.hpp | 3 +
   sandbox/interthreads/boost/interthreads/algorithm/wait_all_until.hpp | 6 ++--
   9 files changed, 56 insertions(+), 20 deletions(-)

Modified: sandbox/interthreads/boost/interthreads/algorithm/detach_all.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/detach_all.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/detach_all.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //

Modified: sandbox/interthreads/boost/interthreads/algorithm/get_all.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/get_all.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/get_all.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //
@@ -11,41 +11,76 @@
 #ifndef BOOST_INTERTHREADS_GET_ALL__HPP
 #define BOOST_INTERTHREADS_GET_ALL__HPP
 
+#include <boost/fusion/include/for_each.hpp>
+#include <boost/fusion/include/zip_view.hpp>
 #include <boost/fusion/include/transform.hpp>
-
-#ifdef BOOST_HAS_CHRONO_LIB
-#include <boost/chono/chono.hpp>
-#else
-#include <boost/thread/thread_time.hpp>
-#endif
+#include <boost/mpl/transform.hpp>
+#include <boost/type_traits/remove_reference.hpp>
 
 #include <boost/config/abi_prefix.hpp>
 
 namespace boost {
 namespace interthreads {
-
     namespace fct {
         struct get {
+ template<typename Sig>
+ struct result;
+
+ template<typename T>
+ struct result<get(T)>
+ {
+ typedef typename boost::remove_reference<T>::type ACT;
+ typedef typename ACT::result_type type;
+ };
+
             template<typename ACT>
             typename ACT::result_type operator()(ACT& act) const {
                 return act.get();
             }
         };
+ struct intrusive_get {
+ template<typename Sig>
+ struct result;
+
+ template<typename T>
+ struct result<intrusive_get(T)>
+ {
+ typedef void type;
+ };
+
+ template<typename ACT_VAL>
+ void operator()(ACT_VAL act_val) const {
+ fusion::at_c<1>(act_val)=fusion::at_c<0>(act_val).get();
+ }
+ };
     }
 
+
     namespace result_of {
         template <typename Sequence>
         struct get_all {
- typedef typename fusion::result_of::transform<Sequence, fct::get>::type type;
+ typedef typename fusion::result_of::transform<Sequence const, fct::get>::type type;
         };
     }
-
     template <typename Sequence>
     typename result_of::get_all<Sequence>::type
     get_all(Sequence& t) {
         return fusion::transform(t, fct::get());
     }
 
+ namespace result_of {
+ template <typename Sequence>
+ struct set_all {
+ typedef void type;
+ };
+ }
+ template <typename SequenceHandles, typename SequenceValues>
+ void set_all(SequenceHandles& handles, SequenceValues& values) {
+ typedef fusion::vector<SequenceHandles&, SequenceValues&> sequences;
+ sequences seqs(handles, values);
+ fusion::zip_view<sequences> zip(seqs);
+ fusion::for_each(zip, fct::intrusive_get());
+ }
 }
 } // namespace boost
 

Modified: sandbox/interthreads/boost/interthreads/algorithm/get_all_until.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/get_all_until.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/get_all_until.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //

Modified: sandbox/interthreads/boost/interthreads/algorithm/interrupt_all.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/interrupt_all.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/interrupt_all.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //

Modified: sandbox/interthreads/boost/interthreads/algorithm/interruption_requested_on_all.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/interruption_requested_on_all.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/interruption_requested_on_all.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //

Modified: sandbox/interthreads/boost/interthreads/algorithm/join_all.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/join_all.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/join_all.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //

Modified: sandbox/interthreads/boost/interthreads/algorithm/join_all_until.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/join_all_until.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/join_all_until.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //

Modified: sandbox/interthreads/boost/interthreads/algorithm/wait_all.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/wait_all.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/wait_all.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //
@@ -29,6 +29,7 @@
             typedef void result_type;
             template<typename ACT>
             void operator()(ACT& act) const {
+ //std::cout << "wait()" << std::endl;
                 act.wait();
             }
         };

Modified: sandbox/interthreads/boost/interthreads/algorithm/wait_all_until.hpp
==============================================================================
--- sandbox/interthreads/boost/interthreads/algorithm/wait_all_until.hpp (original)
+++ sandbox/interthreads/boost/interthreads/algorithm/wait_all_until.hpp 2009-01-14 12:30:12 EST (Wed, 14 Jan 2009)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Vicente J. Botet Escriba 2008. Distributed under the Boost
+// (C) Copyright Vicente J. Botet Escriba 2008-20009. 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)
 //
@@ -64,8 +64,8 @@
     }
     
     template <typename Sequence>
- typename result_of::wait_all_until<Sequence>
- wait_all_until(Sequence& t, const system_time& abs_time) {
+ typename result_of::wait_all_until<Sequence const>
+ wait_all_until(Sequence const& t, const system_time& abs_time) {
         bool r = fct::wait_until(abs_time)(fusion::at_c<0>(t));
                if (r) return true;
         else {


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