Pothos  0.1.1
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
ThreadPool.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
13 #include <memory>
14 #include <string>
15 #include <vector>
16 #include <cstddef>
17 
18 namespace Pothos {
19 
24 {
25 public:
26 
28  ThreadPoolArgs(void);
29 
31  ThreadPoolArgs(const size_t numThreads);
32 
37  size_t numThreads;
38 
48  double priority;
49 
60  std::string affinityMode;
61 
63  std::vector<size_t> affinity;
64 
74  std::string yieldMode;
75 };
76 
84 {
85 public:
86 
88  ThreadPool(void);
89 
91  ThreadPool(const std::shared_ptr<void> &);
92 
98  ThreadPool(const ThreadPoolArgs &args);
99 
104  pothos_explicit operator bool(void) const;
105 
110  const std::shared_ptr<void> &getContainer(void) const;
111 
112 private:
113  std::shared_ptr<void> _impl;
114 };
115 
117 POTHOS_API bool operator==(const ThreadPool &lhs, const ThreadPool &rhs);
118 
119 } //namespace Pothos
std::vector< size_t > affinity
A list of CPUs or NUMA nodes (depends on mode setting)
Definition: ThreadPool.hpp:63
std::string affinityMode
Definition: ThreadPool.hpp:60
#define pothos_explicit
Definition: Config.hpp:85
#define POTHOS_API
Definition: Config.hpp:41
Definition: ThreadPool.hpp:23
std::string yieldMode
Definition: ThreadPool.hpp:74
double priority
Definition: ThreadPool.hpp:48
Definition: ThreadPool.hpp:83
bool operator==(const ManagedBuffer &lhs, const ManagedBuffer &rhs)
Definition: ManagedBuffer.hpp:132
size_t numThreads
Definition: ThreadPool.hpp:37