Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
Platform

Modules

 Assert
 
 Atomics
 
 Machine
 
 Memory
 
 Thread
 
 Utilities
 

Classes

class  gts::InstructionSet
 

Enumerations

enum class  Priority : int32_t {
  PRIORITY_HIGHEST = GTS_THREAD_PRIORITY_HIGHEST , PRIORITY_ABOVE_NORMAL = GTS_THREAD_PRIORITY_ABOVE_NORMAL , PRIORITY_NORMAL = GTS_THREAD_PRIORITY_NORMAL , PRIORITY_BELOW_NORMAL = GTS_THREAD_PRIORITY_BELOW_NORMAL ,
  PRIORITY_LOWEST = GTS_THREAD_PRIORITY_LOWEST
}
 
enum  { DEFAULT_STACK_SIZE = 0 }
 

Functions

GTS_INLINE bool gts::Thread::start (ThreadFunction function, void *pArg, uint32_t stackSize=DEFAULT_STACK_SIZE)
 Starts a thread.
 
GTS_INLINE bool gts::Thread::join ()
 
GTS_INLINE bool gts::Thread::destroy ()
 Destroys the internal resource, if any.
 
GTS_INLINE ThreadId gts::Thread::getId ()
 Returns the handle's unique ID.
 
GTS_INLINE bool gts::Thread::setAffinity (size_t groupId, AffinitySet const &affinity)
 Sets the processor affinity for the thread and returns the previous affinity.
 
GTS_INLINE bool gts::Thread::setPriority (Priority priority)
 Sets the priority for the thread.
 
static GTS_INLINE void gts::Thread::getSystemTopology (SystemTopology &out)
 Gets the topology of all the processors in the system.
 
static GTS_INLINE uint32_t gts::Thread::getHardwareThreadCount ()
 Gets the number of logical processor on this system.
 
static GTS_INLINE void gts::Thread::getCurrentProcessorId (uint32_t &groupId, uint32_t &hwTid)
 Gets the current group and hardware thread IDs.
 
static GTS_INLINE void gts::ThisThread::yield ()
 Yields to another thread on this CPU. (i.e. SwitchToThread on Win32)
 
static GTS_INLINE void gts::ThisThread::sleepFor (uint32_t milliseconds)
 Yields to another thread in this process. (i.e. Sleep(...) on Win32)
 
static GTS_INLINE ThreadId gts::ThisThread::getId ()
 Gets the current threads ID.
 
static GTS_INLINE void gts::ThisThread::setName (const char *name)
 Sets the name of the thread.
 
static GTS_INLINE bool gts::ThisThread::setAffinity (size_t groupId, AffinitySet const &affinity)
 Sets the processor affinity for the thread and returns the previous affinity.
 
static GTS_INLINE bool gts::ThisThread::setPriority (Thread::Priority priority)
 Sets the priority for the thread.
 
bool gts::BinarySemaphore::isWaiting ()
 
bool gts::BinarySemaphore::wait ()
 
void gts::BinarySemaphore::signal ()
 
void gts::BinarySemaphore::reset ()
 

Variables

uint32_t * gts::CpuCoreInfo::pHardwareThreadIds = nullptr
 The ID for each hardware thread in the core.
 
size_t gts::CpuCoreInfo::hardwareThreadIdCount = 0
 The number of elements in pHardwareThreadIds.
 
uint8_t gts::CpuCoreInfo::efficiencyClass = 0
 The efficiency of this core. {0,.., n} => {min,.., max}.
 
CpuCoreInfogts::SocketInfo::pCoreInfoArray = nullptr
 A array of descriptions for each processor core in the socket.
 
size_t gts::SocketInfo::coreInfoElementCount = 0
 The number of elements in pCoreInfoArray.
 
CpuCoreInfogts::NumaNodeInfo::pCoreInfoArray = nullptr
 A array of descriptions for each processor core in the node.
 
size_t gts::NumaNodeInfo::coreInfoElementCount = 0
 The number of elements in pCoreInfoArray.
 
size_t gts::NumaNodeInfo::nodeId = SIZE_MAX
 The ID of the node.
 
CpuCoreInfogts::ProcessorGroupInfo::pCoreInfoArray = nullptr
 A array of descriptions for each processor core in the group.
 
size_t gts::ProcessorGroupInfo::coreInfoElementCount = 0
 The number of elements in pCoreInfoArray.
 
NumaNodeInfogts::ProcessorGroupInfo::pNumaInfoArray = nullptr
 A array of descriptions for each NUMA node.
 
size_t gts::ProcessorGroupInfo::numaNodeInfoElementCount = 0
 The number of elements in pNumaInfoArray.
 
SocketInfogts::ProcessorGroupInfo::pSocketInfoArray = nullptr
 A array of descriptions for each socket.
 
size_t gts::ProcessorGroupInfo::socketInfoElementCount = 0
 The number of elements in pSocketInfoArray.
 
uint32_t gts::ProcessorGroupInfo::groupId = 0
 The ID of the group.
 
ProcessorGroupInfogts::SystemTopology::pGroupInfoArray = nullptr
 A array of descriptions for each processor group.
 
size_t gts::SystemTopology::groupInfoElementCount = 0
 The number of elements in pGroupInfoArray.
 

Detailed Description

Platform specific functionality

Function Documentation

◆ wait()

bool gts::BinarySemaphore::wait ( )
inline
Returns
True if the event was waited on, false otherwise.