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 (
"affinityInit\n");
35 printf (
"================\n");
71 AffinitySet masterAffinity;
77 bool result = workerPool.
initialize(workerPoolDesc);
82 result = microScheduler.
initialize(&workerPool);
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...
void shutdown()
Stops the MicroScheduler and destroys all resources. The TaskSchuduler is now in an unusable state....
A collection of running Worker threads that a MicroScheduler can be run on.
Definition: WorkerPool.h:54
bool initialize(uint32_t threadCount=0)
#define GTS_ASSERT(expr)
Causes execution to break when expr is false.
Definition: Assert.h:144
A description of a CPU core.
Definition: Thread.h:149
A description of a processor group.
Definition: Thread.h:202
A description of the system's processor topology.
Definition: Thread.h:231
The description of a WorkerPool.
Definition: MicroSchedulerTypes.h:172
gts::Vector< WorkerThreadDesc > workerDescs
The description of each worker thread.
Definition: MicroSchedulerTypes.h:184
AffinitySet affinitySet
A set of processor affinities.
Definition: MicroSchedulerTypes.h:100
size_t group
The group the the affinities in affinitySet belong too. Groups seem to only be relevant for Windows....
Definition: MicroSchedulerTypes.h:95
The description of a worker Thread.
Definition: MicroSchedulerTypes.h:87
WorkerThreadDesc::GroupAndAffinity affinity
Specifies the thread affinity for each processor group. See gts::Thread::getSystemTopology to identif...
Definition: MicroSchedulerTypes.h:114