22 #include "gts/platform/Thread.h"
24 #include "gts/micro_scheduler/WorkerPool.h"
25 #include "gts/micro_scheduler/MicroScheduler.h"
29 namespace gts_examples {
33 printf (
"================\n");
34 printf (
"priorityInit\n");
35 printf (
"================\n");
42 constexpr uint32_t PRIORITY_COUNT = 2;
48 for (uint32_t iPriority = 0; iPriority < PRIORITY_COUNT; ++iPriority)
55 workerDesc.
priority = (Thread::Priority)((uint32_t)Thread::Priority::PRIORITY_NORMAL + iPriority);
59 workerPool[iPriority].
initialize(workerPoolDesc);
60 microScheduler[iPriority].
initialize(&workerPool[iPriority]);
A work-stealing task scheduler. The scheduler is executed by the WorkerPool it is initialized with.
Definition: MicroScheduler.h:81
bool initialize(WorkerPool *pWorkerPool)
Initializes the MicroScheduler and attaches it to pWorkPool, where each worker in pWorkPool will exec...
A collection of running Worker threads that a MicroScheduler can be run on.
Definition: WorkerPool.h:54
bool initialize(uint32_t threadCount=0)
The description of a WorkerPool.
Definition: MicroSchedulerTypes.h:172
gts::Vector< WorkerThreadDesc > workerDescs
The description of each worker thread.
Definition: MicroSchedulerTypes.h:184
The description of a worker Thread.
Definition: MicroSchedulerTypes.h:87
Thread::Priority priority
The priority at with the thread is scheduled by the OS.
Definition: MicroSchedulerTypes.h:120