UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FQueuedThreadPoolDynamicWrapper Class Reference

#include <QueuedThreadPoolWrapper.h>

+ Inheritance diagram for FQueuedThreadPoolDynamicWrapper:

Public Member Functions

 FQueuedThreadPoolDynamicWrapper (FQueuedThreadPool *InWrappedQueuedThreadPool, int32 InMaxConcurrency=-1, TFunction< EQueuedWorkPriority(EQueuedWorkPriority)> InPriorityMapper=DefaultQueuedWorkPriorityWrapper)
 
void AddQueuedWork (IQueuedWork *InQueuedWork, EQueuedWorkPriority InPriority=EQueuedWorkPriority::Normal) override
 
void Sort (TFunctionRef< bool(const IQueuedWork *Lhs, const IQueuedWork *Rhs)> Predicate)
 
- Public Member Functions inherited from FQueuedThreadPoolWrapper
CORE_API FQueuedThreadPoolWrapper (FQueuedThreadPool *InWrappedQueuedThreadPool, int32 InMaxConcurrency=-1, TFunction< EQueuedWorkPriority(EQueuedWorkPriority)> InPriorityMapper=DefaultQueuedWorkPriorityWrapper)
 
CORE_API ~FQueuedThreadPoolWrapper ()
 
CORE_API void Pause ()
 
CORE_API void Resume (int32 InNumQueuedWork=-1)
 
CORE_API void SetMaxConcurrency (int32 MaxConcurrency=-1)
 
CORE_API void AddQueuedWork (IQueuedWork *InQueuedWork, EQueuedWorkPriority InPriority=EQueuedWorkPriority::Normal) override
 
CORE_API bool RetractQueuedWork (IQueuedWork *InQueuedWork) override
 
CORE_API int32 GetNumThreads () const override
 
int32 GetCurrentConcurrency () const
 
- Public Member Functions inherited from FQueuedThreadPool
virtual bool CreateForkable (uint32 InNumQueuedThreads, uint32 StackSize=(32 *1024), EThreadPriority ThreadPriority=TPri_Normal, const TCHAR *Name=TEXT("UnknownThreadPool"))
 
CORE_API FQueuedThreadPool ()
 
virtual CORE_API ~FQueuedThreadPool ()
 

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
 
- Protected Member Functions inherited from FQueuedThreadPoolWrapper
virtual int32 GetMaxConcurrency () const
 
virtual void OnScheduled (const IQueuedWork *)
 
virtual void OnUnscheduled (const IQueuedWork *)
 
virtual FScheduledWorkAllocateScheduledWork ()
 
- Protected Attributes inherited from FQueuedThreadPoolWrapper
FCriticalSection Lock
 
FThreadPoolPriorityQueue QueuedWork
 

Detailed Description

ThreadPool wrapper implementation allowing to schedule up to MaxConcurrency tasks at a time making sub-partitioning another thread-pool a breeze and allowing more fine-grained control over scheduling by giving full control of task reordering.

Constructor & Destructor Documentation

◆ FQueuedThreadPoolDynamicWrapper()

FQueuedThreadPoolDynamicWrapper::FQueuedThreadPoolDynamicWrapper ( FQueuedThreadPool InWrappedQueuedThreadPool,
int32  InMaxConcurrency = -1,
TFunction< EQueuedWorkPriority(EQueuedWorkPriority)>  InPriorityMapper = DefaultQueuedWorkPriorityWrapper 
)
inline

InWrappedQueuedThreadPool Underlying thread pool to schedule task to. InMaxConcurrency Maximum number of concurrent tasks allowed, -1 will limit concurrency to number of threads available in the underlying thread pool. 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 underlying thread pool.

Member Function Documentation

◆ AddQueuedWork()

void FQueuedThreadPoolDynamicWrapper::AddQueuedWork ( IQueuedWork InQueuedWork,
EQueuedWorkPriority  InQueuedWorkPriority = EQueuedWorkPriority::Normal 
)
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.

◆ Sort()

void FQueuedThreadPoolDynamicWrapper::Sort ( TFunctionRef< bool(const IQueuedWork *Lhs, const IQueuedWork *Rhs)>  Predicate)
inline

Apply sort predicate to reorder the queued tasks


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