UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FQueuedThreadPoolBase Class Reference
+ Inheritance diagram for FQueuedThreadPoolBase:

Public Member Functions

 FQueuedThreadPoolBase ()
 
virtual ~FQueuedThreadPoolBase ()
 
bool CreateInternal (bool bForkable, uint32 InNumQueuedThreads, uint32 StackSize, EThreadPriority ThreadPriority, const TCHAR *Name)
 
virtual bool Create (uint32 InNumQueuedThreads, uint32 StackSize, EThreadPriority ThreadPriority, const TCHAR *Name) override
 
virtual bool CreateForkable (uint32 InNumQueuedThreads, uint32 StackSize, EThreadPriority ThreadPriority, const TCHAR *Name) override
 
virtual void Destroy () override final
 
int32 GetNumQueuedJobs () const
 
virtual int32 GetNumThreads () const
 
void AddQueuedWork (IQueuedWork *InQueuedWork, EQueuedWorkPriority InQueuedWorkPriority) override
 
virtual bool RetractQueuedWork (IQueuedWork *InQueuedWork) override
 
IQueuedWorkReturnToPoolOrGetNextJob (FQueuedThread *InQueuedThread)
 
- Public Member Functions inherited from FQueuedThreadPool
CORE_API FQueuedThreadPool ()
 
virtual CORE_API ~FQueuedThreadPool ()
 

Protected Attributes

FThreadPoolPriorityQueue QueuedWork
 
TArray< FQueuedThread * > QueuedThreads
 
TArray< FQueuedThread * > AllThreads
 
FCriticalSectionSynchQueue
 
bool TimeToDie
 

Additional Inherited Members

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

Detailed Description

Implementation of a queued thread pool.

Constructor & Destructor Documentation

◆ FQueuedThreadPoolBase()

FQueuedThreadPoolBase::FQueuedThreadPoolBase ( )
inline

Default constructor.

◆ ~FQueuedThreadPoolBase()

virtual FQueuedThreadPoolBase::~FQueuedThreadPoolBase ( )
inlinevirtual

Virtual destructor (cleans up the synchronization objects).

Member Function Documentation

◆ AddQueuedWork()

void FQueuedThreadPoolBase::AddQueuedWork ( IQueuedWork InQueuedWork,
EQueuedWorkPriority  InQueuedWorkPriority 
)
inlineoverridevirtual

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.

◆ Create()

virtual bool FQueuedThreadPoolBase::Create ( uint32  InNumQueuedThreads,
uint32  StackSize,
EThreadPriority  ThreadPriority,
const TCHAR Name 
)
inlineoverridevirtual

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.

◆ CreateForkable()

virtual bool FQueuedThreadPoolBase::CreateForkable ( uint32  InNumQueuedThreads,
uint32  StackSize,
EThreadPriority  ThreadPriority,
const TCHAR Name 
)
inlineoverridevirtual

Creates the thread pool with the specified number of forkable threads (see FForkProcessHelper)

Currently only works after the process has been forked because GetSingleThreadInterface() isn't implemented for pooled 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

Reimplemented from FQueuedThreadPool.

◆ CreateInternal()

bool FQueuedThreadPoolBase::CreateInternal ( bool  bForkable,
uint32  InNumQueuedThreads,
uint32  StackSize,
EThreadPriority  ThreadPriority,
const TCHAR Name 
)
inline

◆ Destroy()

virtual void FQueuedThreadPoolBase::Destroy ( )
inlinefinaloverridevirtual

Tells the pool to clean up all background threads

Implements FQueuedThreadPool.

◆ GetNumQueuedJobs()

int32 FQueuedThreadPoolBase::GetNumQueuedJobs ( ) const
inline

◆ GetNumThreads()

virtual int32 FQueuedThreadPoolBase::GetNumThreads ( ) const
inlinevirtual

Get the number of queued threads

Implements FQueuedThreadPool.

◆ RetractQueuedWork()

virtual bool FQueuedThreadPoolBase::RetractQueuedWork ( IQueuedWork InQueuedWork)
inlineoverridevirtual

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.

◆ ReturnToPoolOrGetNextJob()

IQueuedWork * FQueuedThreadPoolBase::ReturnToPoolOrGetNextJob ( FQueuedThread InQueuedThread)
inline

Member Data Documentation

◆ AllThreads

TArray<FQueuedThread*> FQueuedThreadPoolBase::AllThreads
protected

All threads in the pool.

◆ QueuedThreads

TArray<FQueuedThread*> FQueuedThreadPoolBase::QueuedThreads
protected

The thread pool to dole work out to.

◆ QueuedWork

FThreadPoolPriorityQueue FQueuedThreadPoolBase::QueuedWork
protected

The work queue to pull from.

◆ SynchQueue

FCriticalSection* FQueuedThreadPoolBase::SynchQueue
protected

The synchronization object used to protect access to the queued work.

◆ TimeToDie

bool FQueuedThreadPoolBase::TimeToDie
protected

If true, indicates the destruction process has taken place.


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