Navigation
API > API/Runtime > API/Runtime/Engine
Global singleton manager that can be used to synchronize tasks across different engine systems. This provides event registration and utility functions that wrap functionality in the base Task and TaskGraph systems.
| Name | FTaskSyncManager |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/TaskSyncManager.h |
| Include Path | #include "TaskSyncManager.h" |
Syntax
class FTaskSyncManager
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTaskSyncManager() |
TaskSyncManager.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FTaskSyncManager() |
TaskSyncManager.h |
Structs
| Name | Remarks |
|---|---|
| FBatchData | |
| FRegisteredSyncPointData | |
| FTemporaryWorkRequest |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BatchList | TArray< FBatchData > | Store as a simple array for fast access, there are a small number of active batches. | TaskSyncManager.h | |
| CurrentDeltaTime | float | TaskSyncManager.h | ||
| CurrentTickGroup | ETickingGroup | TaskSyncManager.h | ||
| CurrentTickType | ELevelTick | TaskSyncManager.h | ||
| CurrentTickWorld | const UWorld * | World that is currently ticking, cannot modify certain operations during a tick or tick two worlds at once | TaskSyncManager.h | |
| FActiveSyncPoint | friend | TaskSyncManager.h | ||
| HighestSyncId | FSyncPointId::FInternalId | TaskSyncManager.h | ||
| ManagerLock | FTransactionallySafeCriticalSection | Lock to support multithreaded access. TODO: Investigate if RWLock or command buffer is worth it | TaskSyncManager.h | |
| RegisteredDataMap | TMap< FSyncPointId::FInternalId, FRegisteredSyncPointData > | TaskSyncManager.h | ||
| RegisteredNameMap | TMap< FName, FSyncPointId::FInternalId > | TaskSyncManager.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FGraphEventRef CreateManualTickTask
(
FWorldContextId WorldContext, |
Creates (but does not dispatch) a simple task that will execute a tick function. | TaskSyncManager.h | |
FBatchContextId CreateNewBatch
(
FWorldContextId WorldContext |
Allocates a new batch for the specified world, this will duplicate the events | TaskSyncManager.h | |
void EndFrame
(
const UWorld* InWorld |
Tells the manager that it is the end of a frame and it will not start/end any more tick groups | TaskSyncManager.h | |
void EndTickGroup
(
const UWorld* InWorld, |
Tells the manager that a tick group is complete for a specific world, which could trigger events | TaskSyncManager.h | |
FBatchContextId FindDefaultBatch
(
FWorldContextId WorldContext |
Gets the default batch for a world context. | TaskSyncManager.h | |
FSyncPointId FindSyncPoint
(
FBatchContextId Batch, |
Initializes a sync point id that can be passed between threads and used in the functions below. | TaskSyncManager.h | |
FSyncPointId FindSyncPoint
(
FWorldContextId WorldContext, |
Same as above, but using the default batch for the world context | TaskSyncManager.h | |
| Gets the correct task world context for the current thread context. | TaskSyncManager.h | ||
bool GetSyncPointDescription
(
FName RegisteredName, |
Searches for a registered sync point, if ones is foundw ith that name it will return true and fill in OutDescription | TaskSyncManager.h | |
FTaskSyncResult GetTaskGraphEvent
(
FSyncPointId SyncPoint, |
Attempts to return the current frame's task graph event for this sync point, to pass as a dependency to other tasks. | TaskSyncManager.h | |
FTickFunction * GetTickFunctionForSyncPoint
(
FSyncPointId SyncPoint |
Returns the tick function representing the specified event, if this returns a valid pointer you can use it for setting dependencies but it should not be modified or stored | TaskSyncManager.h | |
bool RegisterNewSyncPoint
(
const FSyncPointDescription& NewDescription |
Registers a new sync point at runtime. RegisteredName and SourceName must be filled out | TaskSyncManager.h | |
FTaskSyncResult RegisterTickGroupWorkHandle
(
FWorldContextId WorldContext, |
Tries to creates a new sync work handle that can be used to reserve or request work to happen on the game thread during a tick group. | TaskSyncManager.h | |
FTaskSyncResult RegisterWorkHandle
(
FSyncPointId SyncPoint, |
Tries to creates a new sync work handle that can be used to reserve or request work to happen as part of a sync point. | TaskSyncManager.h | |
void ReleaseWorldContext
(
FWorldContextId WorldContext |
Tells the manager that it should destroy all tracking info for a world context. | TaskSyncManager.h | |
void ReloadRegisteredData() |
Refresh the registered data from settings | TaskSyncManager.h | |
void StartFrame
(
const UWorld* InWorld, |
Tells the manager that it is the start of a frame, which will register the appropriate events | TaskSyncManager.h | |
void StartTickGroup
(
const UWorld* InWorld, |
Tells the manager that a tick group is starting for a specific world | TaskSyncManager.h | |
FTaskSyncResult TriggerSyncPoint
(
FSyncPointId SyncPoint |
Manually triggers a sync point, this can only be called once per frame | TaskSyncManager.h | |
FTaskSyncResult TriggerSyncPointAfterEvent
(
FSyncPointId SyncPoint, |
Tells the sync point to trigger at the completion of the passed in event/task, this is only possible if it hasn't already been triggered | TaskSyncManager.h | |
| Unregisters a sync point, this will only delete if if both the registered and source names match | TaskSyncManager.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FTaskSyncManager * Get() |
Return the global singleton if it exists | TaskSyncManager.h |