16 #ifndef BLOOMBERG_QUANTUM_DISPATCHER_CORE_H 17 #define BLOOMBERG_QUANTUM_DISPATCHER_CORE_H 20 #include <condition_variable> 31 #include <quantum/quantum_configuration.h> 32 #include <quantum/quantum_task_queue.h> 33 #include <quantum/quantum_io_queue.h> 54 size_t size(
IQueue::QueueType type,
int queueId) const;
56 bool empty(
IQueue::QueueType type,
int queueId) const;
76 bool pinCoroutineThreadsToCores);
80 size_t coroSize(
int queueId) const;
82 size_t ioSize(
int queueId) const;
84 bool coroEmpty(
int queueId) const;
86 bool ioEmpty(
int queueId) const;
96 bool _loadBalanceSharedIoQueues;
97 std::atomic_flag _terminated;
98 std::pair<
int,
int> _coroQueueIdRangeForAny;
103 #include <quantum/impl/quantum_dispatcher_core_impl.h> 105 #endif //BLOOMBERG_QUANTUM_DISPATCHER_CORE_H Long running or blocking task running in the IO thread pool.
Definition: quantum_io_task.h:34
Definition: quantum_buffer_impl.h:22
~DispatcherCore()
Definition: quantum_dispatcher_core_impl.h:76
Thread queue for executing IO tasks.
Definition: quantum_io_queue.h:40
QueueStatistics stats(IQueue::QueueType type, int queueId)
Definition: quantum_dispatcher_core_impl.h:240
Class implementing the dispatching logic unto worker threads. Used for both coroutines and IO tasks.
Definition: quantum_dispatcher_core.h:45
Definition: quantum_stl_impl.h:23
void terminate() final
Terminates the object.
Definition: quantum_dispatcher_core_impl.h:82
int getNumIoThreads() const
Definition: quantum_dispatcher_core_impl.h:423
Runnable object representing a coroutine.
Definition: quantum_task.h:40
Parallel execution engine used to run coroutines or IO tasks asynchronously. This class is the main e...
Definition: quantum_dispatcher.h:34
Interface to a task queue. For internal use only.
Definition: quantum_iqueue.h:33
Provides various counters related to queues and task execution.
Definition: quantum_queue_statistics.h:30
size_t size(IQueue::QueueType type, int queueId) const
Definition: quantum_dispatcher_core_impl.h:102
bool empty(IQueue::QueueType type, int queueId) const
Definition: quantum_dispatcher_core_impl.h:121
Definition: quantum_configuration.h:31
Thread queue for running coroutines.
Definition: quantum_task_queue.h:45
const std::pair< int, int > & getCoroQueueIdRangeForAny() const
Definition: quantum_dispatcher_core_impl.h:429
void postAsyncIo(IoTask::Ptr task)
Definition: quantum_dispatcher_core_impl.h:373
void post(Task::Ptr task)
Definition: quantum_dispatcher_core_impl.h:332
void resetStats()
Definition: quantum_dispatcher_core_impl.h:315
int getNumCoroutineThreads() const
Definition: quantum_dispatcher_core_impl.h:417