35 virtual void run() = 0;
60 : indices_(other.indices_)
72 return indices_.empty();
89ONIXS_CONFLATEDUDP_EXPORTED
103 toStr(str, affinity);
119 std::vector<TaskRunner*>
124 const size_t capacity_;
155 return tasks_.size();
259ONIXS_CONFLATEDUDP_EXPORTED
275 toStr(str, settings);
#define ONIXS_CONFLATEDUDP_LTWT_EXPORTED
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
#define ONIXS_CONFLATEDUDP_EXPORTED_STRUCT
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
#define ONIXS_CONFLATEDUDP_INTERNAL_CLASS_DECL(typeName)
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Represents a set of CPU indices.
ThreadAffinity()
Initializes the empty set.
~ThreadAffinity()
Utilizes internal resources.
ThreadAffinity(const ThreadAffinity &other)
Initializes as a copy of the other set.
CpuIndices & cpus()
Collection of the CPU indices.
const CpuIndices & cpus() const
Read-only access to the indices.
const ThreadAffinity & affinity() const
ThreadAffinity & affinity()
void size(UInt32 value)
Defines the number of working threads in the pool.
~ThreadPoolSettings()
Cleans everything up.
ONIXS_CONFLATEDUDP_EXPORTED void joinAll()
Blocks until all threads accomplish their tasks.
size_t capacity() const
Maximal number of threads maintained by the given pool.
ONIXS_CONFLATEDUDP_EXPORTED void start(Task &, const ThreadAffinity &)
ThreadPool(size_t capacity)
Initializes the pool of the requested capacity.
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
TinySet< CpuIndex > CpuIndices
Alias for collection of CPU indices.
Int32 CpuIndex
Zero-based index of CPU.
Defines an abstraction for a task.
virtual void run()=0
Executes the given task.