35 virtual void run() = 0;
60 : indices_(other.indices_)
72 return indices_.
empty();
89 ONIXS_CONFLATEDUDP_EXPORTED
103 toStr(str, affinity);
119 std::vector<TaskRunner*>
124 const size_t capacity_;
138 : capacity_(capacity)
140 tasks_.reserve(capacity);
155 return tasks_.size();
259 ONIXS_CONFLATEDUDP_EXPORTED
275 toStr(str, settings);
Defines an abstraction for a task.
Int32 CpuIndex
Zero-based index of CPU.
const CpuIndices & cpus() const
Read-only access to the indices.
#define ONIXS_CONFLATEDUDP_LTWT_EXPORTED
Represents a set of CPU indices.
TinySet< CpuIndex > CpuIndices
Alias for collection of CPU indices.
void size(UInt32 value)
Defines the number of working threads in the pool.
#define ONIXS_CONFLATEDUDP_INTERNAL_CLASS_DECL(typeName)
~ThreadAffinity()
Utilizes internal resources.
bool empty() const
Indicates whether the set is empty.
size_t capacity() const
Maximal number of threads maintained by the given pool.
std::string toStr(const ThreadPoolSettings &settings)
Serializes thread pool settings into a string.
ThreadAffinity(const ThreadAffinity &other)
Initializes as a copy of the other set.
CpuIndices & cpus()
Collection of the CPU indices.
ThreadAffinity()
Initializes the empty set.
#define ONIXS_CONFLATEDUDP_EXPORTED_STRUCT
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Manages group of threads executing user-defined tasks.
~ThreadPoolSettings()
Cleans everything up.
bool value(Number &number, const MultiContainer &container, Tag tag)
ThreadAffinity & affinity()
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
const ThreadAffinity & affinity() const
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
ThreadPool(size_t capacity)
Initializes the pool of the requested capacity.