Plasma Engine  2.0
Loading...
Searching...
No Matches
TaskSystemState.h
1#pragma once
2
3#include <Foundation/Threading/TaskSystem.h>
4
6{
7private:
8 friend class plTaskSystem;
9 friend class plTaskWorkerThread;
10
11 // The arrays of all the active worker threads.
12 plDynamicArray<plTaskWorkerThread*> m_Workers[plWorkerThreadType::ENUM_COUNT];
13
14 // the number of allocated (non-null) worker threads in m_Workers
15 plAtomicInteger32 m_iAllocatedWorkers[plWorkerThreadType::ENUM_COUNT];
16
17 // the maximum number of worker threads that should be non-idle (and not blocked) at any time
18 plUInt32 m_uiMaxWorkersToUse[plWorkerThreadType::ENUM_COUNT] = {};
19};
20
22{
23private:
24 friend class plTaskSystem;
25
26 // The target frame time used by FinishFrameTasks()
27 plTime m_TargetFrameTime = plTime::MakeFromSeconds(1.0 / 40.0); // => 25 ms
28
29 // The deque can grow without relocating existing data, therefore the plTaskGroupID's can store pointers directly to the data
30 plDeque<plTaskGroup> m_TaskGroups;
31
32 // The lists of all scheduled tasks, for each priority.
33 plList<plTaskSystem::TaskData> m_Tasks[plTaskPriority::ENUM_COUNT];
34};
Definition Deque.h:270
Definition DynamicArray.h:81
Definition List.h:239
This system allows to automatically distribute tasks onto a number of worker threads.
Definition TaskSystem.h:25
Definition TaskSystemState.h:22
Definition TaskSystemState.h:6
Definition TaskWorkerThread.h:10
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12
PL_ALWAYS_INLINE static constexpr plTime MakeFromSeconds(double fSeconds)
Creates an instance of plTime that was initialized from seconds.
Definition Time.h:30