Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FQueuedThreadPoolTaskGraphWrapper Class Referencefinal

#include <QueuedThreadPoolWrapper.h>

+ Inheritance diagram for FQueuedThreadPoolTaskGraphWrapper:
+ Collaboration diagram for FQueuedThreadPoolTaskGraphWrapper:

Public Member Functions

 FQueuedThreadPoolTaskGraphWrapper (TFunction< ENamedThreads::Type(EQueuedWorkPriority)> InPriorityMapper=nullptr)
 
 FQueuedThreadPoolTaskGraphWrapper (ENamedThreads::Type InDesiredThread)
 
 ~FQueuedThreadPoolTaskGraphWrapper ()
 
- Public Member Functions inherited from FQueuedThreadPool
 FQueuedThreadPool ()
 
virtual ~FQueuedThreadPool ()
 

Protected Member Functions

bool Create (uint32 InNumQueuedThreads, uint32 StackSize, EThreadPriority ThreadPriority, const TCHAR *Name) override
 
void Destroy () override
 

Private Member Functions

void AddQueuedWork (IQueuedWork *InQueuedWork, EQueuedWorkPriority InPriority=EQueuedWorkPriority::Normal) override
 
bool RetractQueuedWork (IQueuedWork *InQueuedWork) override
 
void OnTaskCompleted (IQueuedWork *InQueuedWork)
 
int32 GetNumThreads () const override
 
ENamedThreads::Type GetDefaultPriorityMapping (EQueuedWorkPriority InQueuedWorkPriority)
 

Private Attributes

TFunction< ENamedThreads::Type(EQueuedWorkPriority)> PriorityMapper
 
TAtomic< uint32TaskCount
 
TAtomic< boolbIsExiting
 

Additional Inherited Members

- Static Public Member Functions inherited from FQueuedThreadPool
static FQueuedThreadPoolAllocate ()
 
- Static Public Attributes inherited from FQueuedThreadPool
static uint32 OverrideStackSize
 

Detailed Description

ThreadPool wrapper implementation allowing to schedule thread-pool tasks on the task graph.

Definition at line 245 of file QueuedThreadPoolWrapper.h.

Constructor & Destructor Documentation

◆ FQueuedThreadPoolTaskGraphWrapper() [1/2]

FQueuedThreadPoolTaskGraphWrapper::FQueuedThreadPoolTaskGraphWrapper ( TFunction< ENamedThreads::Type(EQueuedWorkPriority)> InPriorityMapper = nullptr)
inline

InPriorityMapper Thread-safe function used to map any priority from this Queue to the priority that should be used when scheduling the task on the task graph.

Definition at line 251 of file QueuedThreadPoolWrapper.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FQueuedThreadPoolTaskGraphWrapper() [2/2]

FQueuedThreadPoolTaskGraphWrapper::FQueuedThreadPoolTaskGraphWrapper ( ENamedThreads::Type InDesiredThread)
inline

InDesiredThread The task-graph desired thread and priority.

Definition at line 268 of file QueuedThreadPoolWrapper.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~FQueuedThreadPoolTaskGraphWrapper()

FQueuedThreadPoolTaskGraphWrapper::~FQueuedThreadPoolTaskGraphWrapper ( )
inline

Definition at line 275 of file QueuedThreadPoolWrapper.h.

+ Here is the call graph for this function:

Member Function Documentation

◆ AddQueuedWork()

void FQueuedThreadPoolTaskGraphWrapper::AddQueuedWork ( IQueuedWork * InQueuedWork,
EQueuedWorkPriority InQueuedWorkPriority = EQueuedWorkPriority::Normal )
inlineoverrideprivatevirtual

Checks to see if there is a thread available to perform the task. If not, it queues the work for later. Otherwise it is immediately dispatched.

Parameters
InQueuedWorkThe work that needs to be done asynchronously
InQueuedWorkPriorityThe priority at which to process this task
See also
RetractQueuedWork

Implements FQueuedThreadPool.

Definition at line 280 of file QueuedThreadPoolWrapper.h.

◆ Create()

bool FQueuedThreadPoolTaskGraphWrapper::Create ( uint32 InNumQueuedThreads,
uint32 StackSize,
EThreadPriority ThreadPriority,
const TCHAR * Name )
inlineoverrideprotectedvirtual

Creates the thread pool with the specified number of threads

Parameters
InNumQueuedThreadsSpecifies the number of threads to use in the pool
StackSizeThe size of stack the threads in the pool need (32K default)
ThreadPrioritypriority of new pool thread
Nameoptional name for the pool to be used for instrumentation
Returns
Whether the pool creation was successful or not

Implements FQueuedThreadPool.

Definition at line 327 of file QueuedThreadPoolWrapper.h.

◆ Destroy()

void FQueuedThreadPoolTaskGraphWrapper::Destroy ( )
inlineoverrideprotectedvirtual

Tells the pool to clean up all background threads

Implements FQueuedThreadPool.

Definition at line 332 of file QueuedThreadPoolWrapper.h.

+ Here is the caller graph for this function:

◆ GetDefaultPriorityMapping()

ENamedThreads::Type FQueuedThreadPoolTaskGraphWrapper::GetDefaultPriorityMapping ( EQueuedWorkPriority InQueuedWorkPriority)
inlineprivate

Definition at line 313 of file QueuedThreadPoolWrapper.h.

◆ GetNumThreads()

int32 FQueuedThreadPoolTaskGraphWrapper::GetNumThreads ( ) const
inlineoverrideprivatevirtual

Get the number of queued threads

Implements FQueuedThreadPool.

Definition at line 308 of file QueuedThreadPoolWrapper.h.

◆ OnTaskCompleted()

void FQueuedThreadPoolTaskGraphWrapper::OnTaskCompleted ( IQueuedWork * InQueuedWork)
inlineprivate

Definition at line 303 of file QueuedThreadPoolWrapper.h.

◆ RetractQueuedWork()

bool FQueuedThreadPoolTaskGraphWrapper::RetractQueuedWork ( IQueuedWork * InQueuedWork)
inlineoverrideprivatevirtual

Attempts to retract a previously queued task.

Parameters
InQueuedWorkThe work to try to retract
Returns
true if the work was retracted
See also
AddQueuedWork

Implements FQueuedThreadPool.

Definition at line 297 of file QueuedThreadPoolWrapper.h.

Member Data Documentation

◆ bIsExiting

TAtomic<bool> FQueuedThreadPoolTaskGraphWrapper::bIsExiting
private

Definition at line 351 of file QueuedThreadPoolWrapper.h.

◆ PriorityMapper

TFunction<ENamedThreads::Type (EQueuedWorkPriority)> FQueuedThreadPoolTaskGraphWrapper::PriorityMapper
private

Definition at line 349 of file QueuedThreadPoolWrapper.h.

◆ TaskCount

TAtomic<uint32> FQueuedThreadPoolTaskGraphWrapper::TaskCount
private

Definition at line 350 of file QueuedThreadPoolWrapper.h.


The documentation for this class was generated from the following file: