25 #include "gts/platform/Thread.h"
27 #include "gts/micro_scheduler/WorkerPool.h"
28 #include "gts/micro_scheduler/MicroScheduler.h"
29 #include "gts/micro_scheduler/patterns/ParallelFor.h"
30 #include "gts/micro_scheduler/patterns/Range1d.h"
34 namespace gts_examples {
38 printf (
"================\n");
39 printf (
"isolationInit\n");
40 printf (
"================\n");
54 constexpr uint32_t NUM_SCHEDUELRS = 2;
58 for (uint32_t iScheduler = 0; iScheduler < NUM_SCHEDUELRS; ++iScheduler)
60 microScheduler[iScheduler].
initialize(&workerPool);
66 const uint32_t elementCount = 1000;
76 std::vector<uint32_t>& threadLocalValues = *(std::vector<uint32_t>*)pData;
93 std::cout <<
"Isolated: Executed an outer loop iteration will waiting on inner loop.\n";
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...
GTS_INLINE SubIdType localId() const
Definition: Utils.h:317
A construct that maps parallel-for behavior to a MicroScheduler.
Definition: ParallelFor.h:48
An iteration range over a 1D data set. Splits divide the range in two based unless the minimum size i...
Definition: Range1d.h:56
Recursively splits a range and tries to limit number of splits to the number of workers in the execut...
Definition: Partitioners.h:114
A collection of running Worker threads that a MicroScheduler can be run on.
Definition: WorkerPool.h:54
bool initialize(uint32_t threadCount=0)
The context associated with the task being executed.
Definition: MicroSchedulerTypes.h:54
OwnedId workerId
The ID of the current Worker.
Definition: MicroSchedulerTypes.h:65