Pothos  0.4.1-gb758ed46
The Pothos dataflow programming software suite
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 
49  ThreadPoolArgs(const std::string &json);
50 
56  size_t numThreads;
57 
67  double priority;
68 
79  std::string affinityMode;
80 
82  std::vector<size_t> affinity;
83 
93  std::string yieldMode;
94 };
95 
114 {
115 public:
116 
118  ThreadPool(void);
119 
121  ThreadPool(const std::shared_ptr<void> &);
122 
128  ThreadPool(const ThreadPoolArgs &args);
129 
134  explicit operator bool(void) const;
135 
140  const std::shared_ptr<void> &getContainer(void) const;
141 
142 private:
143  std::shared_ptr<void> _impl;
144 };
145 
147 POTHOS_API bool operator==(const ThreadPool &lhs, const ThreadPool &rhs);
148 
149 } //namespace Pothos
std::vector< size_t > affinity
A list of CPUs or NUMA nodes (depends on mode setting)
Definition: ThreadPool.hpp:82
std::string affinityMode
Definition: ThreadPool.hpp:79
#define POTHOS_API
Definition: Config.hpp:41
Definition: ThreadPool.hpp:23
std::string yieldMode
Definition: ThreadPool.hpp:93
double priority
Definition: ThreadPool.hpp:67
Definition: ThreadPool.hpp:113
Definition: Testing.hpp:134
bool operator==(const ManagedBuffer &lhs, const ManagedBuffer &rhs)
Definition: ManagedBuffer.hpp:261
size_t numThreads
Definition: ThreadPool.hpp:56