summaryrefslogtreecommitdiff
path: root/include/gnuradio
diff options
context:
space:
mode:
authorJosh Blum2012-10-28 11:40:59 -0700
committerJosh Blum2012-10-28 11:40:59 -0700
commitcbcedb10e8f59ac696478460c21150b811e8d083 (patch)
tree81fdae1d565fad7c8232a39538dee7630aa131d4 /include/gnuradio
parent25ec793e687821bd2ac5862fcf934c4c9c0f47b6 (diff)
parentebd812fd4702cbe5c9ef487f6efc8a4e0eb165e9 (diff)
downloadsandhi-cbcedb10e8f59ac696478460c21150b811e8d083.tar.gz
sandhi-cbcedb10e8f59ac696478460c21150b811e8d083.tar.bz2
sandhi-cbcedb10e8f59ac696478460c21150b811e8d083.zip
Merge branch 'rc0_work'
Conflicts: Apology
Diffstat (limited to 'include/gnuradio')
-rw-r--r--include/gnuradio/thread_pool.hpp41
1 files changed, 34 insertions, 7 deletions
diff --git a/include/gnuradio/thread_pool.hpp b/include/gnuradio/thread_pool.hpp
index c0adc1c..d34c161 100644
--- a/include/gnuradio/thread_pool.hpp
+++ b/include/gnuradio/thread_pool.hpp
@@ -20,6 +20,7 @@
#include <gnuradio/gras.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
+#include <string>
//! ThreadPool is an unexposed Theron Framework
//! Forward declare the Framwork for c++ users
@@ -31,6 +32,38 @@ namespace Theron
namespace gnuradio
{
+struct GRAS_API ThreadPoolConfig
+{
+ ThreadPoolConfig(void);
+
+ /*!
+ * The initial number of worker threads to create within the framework.
+ * Default is the number of CPUs on the system.
+ */
+ size_t thread_count;
+
+ /*!
+ * Specifies the NUMA processor nodes upon which the framework may execute.
+ * Default is all NUMA nodes on the system.
+ */
+ size_t node_mask;
+
+ /*!
+ * Specifies the subset of the processors in each NUMA processor node upon which the framework may execute.
+ * Default is all CPUs per NUMA node.
+ */
+ size_t processor_mask;
+
+ /*!
+ * Yield strategy employed by the worker threads in the framework.
+ * POLITE, ///< Threads go to sleep when not in use.
+ * STRONG, ///< Threads yield to other threads but don't go to sleep.
+ * AGGRESSIVE ///< Threads never yield to other threads.
+ * Default is STRONG.
+ */
+ std::string yield_strategy;
+};
+
/*!
* Thread Pool is is a this wrapper of Theron Framework, see link for more details:
* http://docs.theron-library.com/5.00/structTheron_1_1Framework_1_1Parameters.html
@@ -44,13 +77,7 @@ struct GRAS_API ThreadPool : boost::shared_ptr<Theron::Framework>
ThreadPool(boost::weak_ptr<Theron::Framework> p);
//! Create a new thread pool with parameters
- ThreadPool(const unsigned long threadCount);
-
- //! Create a new thread pool with parameters
- ThreadPool(const unsigned long threadCount, const unsigned long nodeMask);
-
- //! Create a new thread pool with parameters
- ThreadPool(const unsigned long threadCount, const unsigned long nodeMask, const unsigned long processorMask);
+ ThreadPool(const ThreadPoolConfig &config);
/*!
* When a block is created, it will execute in the active pool.