Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58459 - in sandbox/fiber: boost/fiber libs/fiber/doc libs/fiber/src
From: oliver.kowalke_at_[hidden]
Date: 2009-12-18 16:24:46


Author: olli
Date: 2009-12-18 16:24:45 EST (Fri, 18 Dec 2009)
New Revision: 58459
URL: http://svn.boost.org/trac/boost/changeset/58459

Log:
- function returning runnable fibers added to scheduler

Text files modified:
   sandbox/fiber/boost/fiber/round_robin.hpp | 2 ++
   sandbox/fiber/boost/fiber/scheduler.hpp | 3 +++
   sandbox/fiber/boost/fiber/strategy.hpp | 2 ++
   sandbox/fiber/libs/fiber/doc/fiber_ref.qbk | 17 +++++++++++++++++
   sandbox/fiber/libs/fiber/src/round_robin.cpp | 4 ++++
   5 files changed, 28 insertions(+), 0 deletions(-)

Modified: sandbox/fiber/boost/fiber/round_robin.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/round_robin.hpp (original)
+++ sandbox/fiber/boost/fiber/round_robin.hpp 2009-12-18 16:24:45 EST (Fri, 18 Dec 2009)
@@ -100,6 +100,8 @@
         bool empty();
 
         std::size_t size();
+
+ std::size_t ready();
 };
 
 }}

Modified: sandbox/fiber/boost/fiber/scheduler.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/scheduler.hpp (original)
+++ sandbox/fiber/boost/fiber/scheduler.hpp 2009-12-18 16:24:45 EST (Fri, 18 Dec 2009)
@@ -67,6 +67,9 @@
         std::size_t size()
         { return strategy_->size(); }
 
+ std::size_t ready()
+ { return strategy_->ready(); }
+
         void submit_fiber( fiber f)
         { strategy_->add( f); }
 

Modified: sandbox/fiber/boost/fiber/strategy.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/strategy.hpp (original)
+++ sandbox/fiber/boost/fiber/strategy.hpp 2009-12-18 16:24:45 EST (Fri, 18 Dec 2009)
@@ -187,6 +187,8 @@
 
         virtual std::size_t size() = 0;
 
+ virtual std::size_t ready() = 0;
+
         inline friend void intrusive_ptr_add_ref( strategy * p)
         { ++p->use_count_; }
         

Modified: sandbox/fiber/libs/fiber/doc/fiber_ref.qbk
==============================================================================
--- sandbox/fiber/libs/fiber/doc/fiber_ref.qbk (original)
+++ sandbox/fiber/libs/fiber/doc/fiber_ref.qbk 2009-12-18 16:24:45 EST (Fri, 18 Dec 2009)
@@ -754,6 +754,8 @@
 
                 std::size_t size();
 
+ std::size_t ready();
+
                 void submit_fiber( fiber);
 
                 template< typename Fn >
@@ -813,6 +815,13 @@
 ]
 [endsect]
 
+[section:ready `std::size_t ready()`]
+[variablelist
+[[Effects:] [Returns how many fibers are ready to run in the scheduler.]]
+[[Throws:] [Nothing.]]
+]
+[endsect]
+
 [section:submit_fiber `void submit_fiber( fiber f)`]
 [variablelist
 [[Effects:] [This function stores the passed fiber in the scheduler.]]
@@ -925,6 +934,7 @@
                 virtual bool run() = 0;
                 virtual bool empty() = 0;
                 virtual std::size_t size() = 0;
+ virtual std::size_t ready() = 0;
         };
 
 
@@ -1204,6 +1214,13 @@
 ]
 [endsect]
 
+[section:ready `virtual std::size_t ready() = 0`]
+[variablelist
+[[Effects:] [Returns how many fibers are ready to run in the scheduler.]]
+[[Throws:] [Nothing.]]
+]
+[endsect]
+
 [endsect]
 
 [section:round_robin Class `round_robin`]

Modified: sandbox/fiber/libs/fiber/src/round_robin.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/round_robin.cpp (original)
+++ sandbox/fiber/libs/fiber/src/round_robin.cpp 2009-12-18 16:24:45 EST (Fri, 18 Dec 2009)
@@ -442,6 +442,10 @@
 round_robin::size()
 { return fibers_.size(); }
 
+std::size_t
+round_robin::ready()
+{ return runnable_fibers_.size(); }
+
 }}
 
 #include <boost/config/abi_suffix.hpp>


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