OmniSciDB
a5dc49c757
|
#include <QueryDispatchQueue.h>
Public Types | |
using | Task = std::packaged_task< void(size_t)> |
Public Member Functions | |
QueryDispatchQueue (const size_t parallel_executors_max) | |
void | submit (std::shared_ptr< Task > task, const bool is_update_delete) |
bool | hasIdleWorker () |
~QueryDispatchQueue () | |
Private Member Functions | |
void | worker (const size_t worker_idx) |
Private Attributes | |
std::mutex | queue_mutex_ |
std::condition_variable | cv_ |
std::mutex | update_delete_mutex_ |
bool | threads_should_exit_ {false} |
std::queue< std::shared_ptr < Task > > | queue_ |
std::vector< std::thread > | workers_ |
int | num_running_workers_ |
int | num_workers_ |
QueryDispatchQueue maintains a list of pending queries and dispatches those queries as Executors become available
Definition at line 29 of file QueryDispatchQueue.h.
using QueryDispatchQueue::Task = std::packaged_task<void(size_t)> |
Definition at line 31 of file QueryDispatchQueue.h.
|
inline |
Definition at line 33 of file QueryDispatchQueue.h.
References num_running_workers_, num_workers_, worker(), and workers_.
|
inline |
Definition at line 74 of file QueryDispatchQueue.h.
References cv_, queue_mutex_, threads_should_exit_, worker(), and workers_.
|
inline |
Definition at line 69 of file QueryDispatchQueue.h.
References num_running_workers_, num_workers_, and queue_mutex_.
|
inline |
Submit a new task to the queue. Blocks until the task begins execution. The caller is expected to maintain a copy of the shared_ptr which will be used to access results once the task runs.
Definition at line 48 of file QueryDispatchQueue.h.
References CHECK, cv_, logger::INFO, LOG, queue_, queue_mutex_, update_delete_mutex_, and workers_.
|
inlineprivate |
Definition at line 86 of file QueryDispatchQueue.h.
References CHECK, cv_, logger::INFO, LOG, num_running_workers_, queue_, queue_mutex_, and threads_should_exit_.
Referenced by QueryDispatchQueue(), and ~QueryDispatchQueue().
|
private |
Definition at line 116 of file QueryDispatchQueue.h.
Referenced by submit(), worker(), and ~QueryDispatchQueue().
|
private |
Definition at line 123 of file QueryDispatchQueue.h.
Referenced by hasIdleWorker(), QueryDispatchQueue(), and worker().
|
private |
Definition at line 124 of file QueryDispatchQueue.h.
Referenced by hasIdleWorker(), and QueryDispatchQueue().
|
private |
Definition at line 121 of file QueryDispatchQueue.h.
|
private |
Definition at line 115 of file QueryDispatchQueue.h.
Referenced by hasIdleWorker(), submit(), worker(), and ~QueryDispatchQueue().
|
private |
Definition at line 120 of file QueryDispatchQueue.h.
Referenced by worker(), and ~QueryDispatchQueue().
|
private |
Definition at line 118 of file QueryDispatchQueue.h.
Referenced by submit().
|
private |
Definition at line 122 of file QueryDispatchQueue.h.
Referenced by QueryDispatchQueue(), submit(), and ~QueryDispatchQueue().