Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
gts::WorkerPoolDesc Struct Reference

The description of a WorkerPool. More...

#include <MicroSchedulerTypes.h>

Public Types

using SetThreadLocalStateFcn = void(*)(uintptr_t state)
 
using GetThreadLocalStateFcn = uintptr_t(*)()
 

Public Attributes

gts::Vector< WorkerThreadDescworkerDescs
 The description of each worker thread. More...
 
SetThreadLocalStateFcn pSetThreadLocalStateFcn = nullptr
 The setter for the thread local value that holds each worker thread's index. Useful for cross DLL thread local storage. Uses default if nullptr.
 
GetThreadLocalStateFcn pGetThreadLocalStateFcn = nullptr
 The getter for the thread local value that holds each worker thread's index. Useful for cross DLL thread local storage. Uses default if nullptr.
 
WorkerPoolVisitorpVisitor = nullptr
 A user-defined visitor object for the WorkerPool. The object must stay alive for the lifetime of the WorkerPool.
 
uint32_t cachableTaskSize = GTS_NO_SHARING_CACHE_LINE_SIZE * 2
 The maximum size of Tasks that are cached and reused. Sizes larger than this will be allocated from the heap.
 
uint32_t initialTaskCountPerWorker = 0
 The number of Tasks to create and cache per Worker during initialization.
 
char name [DESC_NAME_SIZE] = { 0 }
 A name to help with debugging.
 

Detailed Description

The description of a WorkerPool.

Member Data Documentation

◆ workerDescs

gts::Vector<WorkerThreadDesc> gts::WorkerPoolDesc::workerDescs

The description of each worker thread.

Remarks
The "master" thread calling WorkerPool::Initialize will use index zero, BUT it will not be altered. The user should set these properties manually on the master thread if they are desired.