Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
PImpl-ed implementation of the Task manager. More...
Public Member Functions | |
Impl ()=default | |
~Impl () | |
void | SetupWorkers (size_t numberOfWorkers) |
2-phase init to avoid having to think too hard about the order of class members. More... | |
void | PushTask (std::function< void()> &&task, TaskPriority priority) |
Push a task on the global queue. More... | |
Protected Member Functions | |
void | ClearQueue () |
template<TaskPriority Priority> | |
bool | PopTask (std::function< void()> &taskOut) |
Protected Attributes | |
std::atomic< bool > | m_HasWork = false |
std::atomic< bool > | m_HasLowPriorityWork = false |
std::mutex | m_GlobalMutex |
std::mutex | m_GlobalLowPriorityMutex |
std::deque< QueueItem > | m_GlobalQueue |
std::deque< QueueItem > | m_GlobalLowPriorityQueue |
std::deque< WorkerThread > | m_Workers |
Friends | |
class | TaskManager |
class | WorkerThread |
PImpl-ed implementation of the Task manager.
The normal priority queue is processed first, the low priority only if there are no higher-priority tasks
|
default |
|
inline |
|
protected |
|
protected |
void Threading::TaskManager::Impl::PushTask | ( | std::function< void()> && | task, |
TaskPriority | priority | ||
) |
Push a task on the global queue.
Takes ownership of task. May be called from any thread.
void Threading::TaskManager::Impl::SetupWorkers | ( | size_t | numberOfWorkers | ) |
2-phase init to avoid having to think too hard about the order of class members.
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |