Navigation
API > API/Runtime > API/Runtime/Core
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 effectively giving another set of priorities.
| Name | FQueuedThreadPoolWrapper |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/QueuedThreadPoolWrapper.h |
| Include Path | #include "Misc/QueuedThreadPoolWrapper.h" |
Syntax
class FQueuedThreadPoolWrapper : public FQueuedThreadPool
Inheritance Hierarchy
- FQueuedThreadPool → FQueuedThreadPoolWrapper
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FQueuedThreadPoolWrapper
(
FQueuedThreadPool* InWrappedQueuedThreadPool, |
InWrappedQueuedThreadPool Underlying thread pool to schedule task to. | Misc/QueuedThreadPoolWrapper.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FQueuedThreadPoolWrapper() |
Misc/QueuedThreadPoolWrapper.h |
Classes
| Name | Remarks |
|---|---|
| FScheduledWork |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsScheduling | bool | Misc/QueuedThreadPoolWrapper.h | ||
| CurrentConcurrency | std::atomic< int32 > | Misc/QueuedThreadPoolWrapper.h | ||
| MaxConcurrency | std::atomic< int32 > | Misc/QueuedThreadPoolWrapper.h | ||
| MaxTaskToSchedule | int32 | Misc/QueuedThreadPoolWrapper.h | ||
| PriorityMapper | TFunction< EQueuedWorkPriority(EQueuedWorkPriority)> | Misc/QueuedThreadPoolWrapper.h | ||
| ScheduledWork | TMap< IQueuedWork *, FScheduledWork * > | Misc/QueuedThreadPoolWrapper.h | ||
| WorkPool | TArray< FScheduledWork * > | Misc/QueuedThreadPoolWrapper.h | ||
| WrappedQueuedThreadPool | FQueuedThreadPool * | Misc/QueuedThreadPoolWrapper.h | ||
| WrappedQueuePriority | EQueuedWorkPriority | Misc/QueuedThreadPoolWrapper.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 GetCurrentConcurrency() |
Misc/QueuedThreadPoolWrapper.h | ||
void Pause() |
Queued task are not scheduled against the wrapped thread-pool until resumed | Misc/QueuedThreadPoolWrapper.h | |
void Resume
(
int32 InNumQueuedWork |
Resume a specified amount of queued work, or -1 to unpause. | Misc/QueuedThreadPoolWrapper.h | |
void SetMaxConcurrency
(
int32 MaxConcurrency |
Dynamically adjust the maximum number of concurrent tasks, -1 for unlimited. | Misc/QueuedThreadPoolWrapper.h |
Overridden from FQueuedThreadPool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddQueuedWork
(
IQueuedWork* InQueuedWork, |
Checks to see if there is a thread available to perform the task. | Misc/QueuedThreadPoolWrapper.h | |
virtual int32 GetNumThreads() |
Get the number of queued threads | Misc/QueuedThreadPoolWrapper.h | |
virtual bool RetractQueuedWork
(
IQueuedWork* InQueuedWork |
Attempts to retract a previously queued task. | Misc/QueuedThreadPoolWrapper.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FScheduledWork * AllocateScheduledWork() |
Can be overriden to allocate a more specialized version if needed. | Misc/QueuedThreadPoolWrapper.h | |
virtual int32 GetMaxConcurrency() |
Can be overriden to dynamically control the maximum concurrency. | Misc/QueuedThreadPoolWrapper.h | |
virtual void OnScheduled
(
const IQueuedWork* |
Can be overriden to know when work has been scheduled. | Misc/QueuedThreadPoolWrapper.h | |
virtual void OnUnscheduled
(
const IQueuedWork* |
Can be overriden to know when work has been unscheduled. | Misc/QueuedThreadPoolWrapper.h |