Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FQueuedThreadPool Class Referenceabstract

#include <QueuedThreadPool.h>

+ Inheritance diagram for FQueuedThreadPool:

Public Member Functions

virtual bool Create (uint32 InNumQueuedThreads, uint32 StackSize=(32 *1024), EThreadPriority ThreadPriority=TPri_Normal, const TCHAR *Name=TEXT("UnknownThreadPool"))=0
 
virtual void Destroy ()=0
 
virtual void AddQueuedWork (IQueuedWork *InQueuedWork, EQueuedWorkPriority InQueuedWorkPriority=EQueuedWorkPriority::Normal)=0
 
virtual bool RetractQueuedWork (IQueuedWork *InQueuedWork)=0
 
virtual int32 GetNumThreads () const =0
 
 FQueuedThreadPool ()
 
virtual ~FQueuedThreadPool ()
 

Static Public Member Functions

static FQueuedThreadPoolAllocate ()
 

Static Public Attributes

static uint32 OverrideStackSize
 

Detailed Description

Interface for queued thread pools.

This interface is used by all queued thread pools. It used as a callback by FQueuedThreads and is used to queue asynchronous work for callers.

Definition at line 103 of file QueuedThreadPool.h.

Constructor & Destructor Documentation

◆ FQueuedThreadPool()

FQueuedThreadPool::FQueuedThreadPool ( )

◆ ~FQueuedThreadPool()

virtual FQueuedThreadPool::~FQueuedThreadPool ( )
virtual

Member Function Documentation

◆ AddQueuedWork()

virtual void FQueuedThreadPool::AddQueuedWork ( IQueuedWork * InQueuedWork,
EQueuedWorkPriority InQueuedWorkPriority = EQueuedWorkPriority::Normal )
pure virtual

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

Implemented in FQueuedThreadPoolWrapper, FQueuedThreadPoolDynamicWrapper, FQueuedThreadPoolTaskGraphWrapper, and FQueuedLowLevelThreadPool.

◆ Allocate()

static FQueuedThreadPool * FQueuedThreadPool::Allocate ( )
static

Allocates a thread pool

Returns
A new thread pool.

◆ Create()

virtual bool FQueuedThreadPool::Create ( uint32 InNumQueuedThreads,
uint32 StackSize = (32 *1024),
EThreadPriority ThreadPriority = TPri_Normal,
const TCHAR * Name = TEXT("UnknownThreadPool") )
pure virtual

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

Implemented in FQueuedLowLevelThreadPool, FQueuedThreadPoolWrapper, and FQueuedThreadPoolTaskGraphWrapper.

◆ Destroy()

virtual void FQueuedThreadPool::Destroy ( )
pure virtual

Tells the pool to clean up all background threads

Implemented in FQueuedThreadPoolWrapper, FQueuedThreadPoolTaskGraphWrapper, and FQueuedLowLevelThreadPool.

◆ GetNumThreads()

virtual int32 FQueuedThreadPool::GetNumThreads ( ) const
pure virtual

Get the number of queued threads

Implemented in FQueuedThreadPoolWrapper, FQueuedThreadPoolTaskGraphWrapper, and FQueuedLowLevelThreadPool.

◆ RetractQueuedWork()

virtual bool FQueuedThreadPool::RetractQueuedWork ( IQueuedWork * InQueuedWork)
pure virtual

Attempts to retract a previously queued task.

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

Implemented in FQueuedThreadPoolWrapper, FQueuedThreadPoolTaskGraphWrapper, and FQueuedLowLevelThreadPool.

Member Data Documentation

◆ OverrideStackSize

uint32 FQueuedThreadPool::OverrideStackSize
static

Stack size for threads created for the thread pool. Can be overridden by other projects. If 0 means to use the value passed in the Create method.

Definition at line 162 of file QueuedThreadPool.h.


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