ThreadPool::Context
Engine/source/platform/threads/threadPool.h
A ThreadPool context defines a logical context in which WorkItems are being executed.
Protected Attributes
Accumulated scale factor.
Priority scale factor of this context.
Protected Static Attributes
The root context; does not modify priorities. All contexts should be direct or indirect children of this one.
Protected Functions
Recursively update cached accumulated priority biases.
Public Functions
~Context()
Context *
Return the first child context.
Return the context's own work item priority bias.
Context *
Return the next sibling to the current context.
setPriorityBias(F32 value)
Public Static Functions
Context *
Return the root context.
Detailed Description
A ThreadPool context defines a logical context in which WorkItems are being executed.
Their primary use is for biasing priorities of WorkItems.
Contexts are arranged in a tree hierarchy. Each parent node's priority bias scales all the priority biases underneath it.
Note that instances of this class are meant to be instantiated globally only.
Protected Attributes
F32 mAccumulatedPriorityBias
Accumulated scale factor.
Context * mChildren
First child.
const char * mName
Name of this context. Should be unique in parent namespace.
Context * mParent
Superordinate context; scales this context's priority bias.
F32 mPriorityBias
Priority scale factor of this context.
Context * mSibling
Next sibling in child chain.
Protected Static Attributes
Context smRootContext
The root context; does not modify priorities. All contexts should be direct or indirect children of this one.
Protected Functions
updateAccumulatedPriorityBiases()
Recursively update cached accumulated priority biases.
Public Functions
Context(const char * name, Context * parent, F32 priorityBias)
~Context()
getAccumulatedPriorityBias()
getChild(const char * name)
getChildren()
Return the first child context.
getName()
Return the name of the worker threading context.
getParent()
Return the superordinate node to the current context.
getPriorityBias()
Return the context's own work item priority bias.
getSibling()
Return the next sibling to the current context.
setPriorityBias(F32 value)