tick.AllowConcurrentTickQueue
tick.AllowConcurrentTickQueue
#Overview
name: tick.AllowConcurrentTickQueue
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, queue ticks concurrently.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of tick.AllowConcurrentTickQueue is to control whether ticks are queued concurrently in Unreal Engine’s tick system. This setting variable is primarily used for performance optimization in the engine’s core tick management system.
The Unreal Engine subsystem that relies on this setting variable is the Tick Task Manager, which is part of the engine’s core runtime module. This can be seen from the file location “Engine/Source/Runtime/Engine/Private/TickTaskManager.cpp”.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 (true), meaning concurrent tick queuing is enabled by default.
The associated variable CVarAllowConcurrentQueue interacts directly with tick.AllowConcurrentTickQueue. They share the same value and purpose.
Developers must be aware that this variable affects the threading behavior of the tick system. When enabled (set to 1), it allows for concurrent queuing of ticks, which can potentially improve performance on multi-core systems. However, it may also introduce synchronization complexities.
Best practices when using this variable include:
- Testing thoroughly with both enabled and disabled states to ensure game stability.
- Monitoring performance metrics to determine if concurrent queuing benefits your specific game.
- Being cautious when modifying this variable in shipping builds, as it can significantly affect game behavior.
Regarding the associated variable CVarAllowConcurrentQueue:
The purpose of CVarAllowConcurrentQueue is to provide programmatic access to the tick.AllowConcurrentTickQueue setting within the C++ code.
It’s used directly in the FTickTaskManager class to determine whether to use concurrent queuing for ticks. This happens at the start of each frame in the StartFrame function.
The value of CVarAllowConcurrentQueue is set automatically based on the tick.AllowConcurrentTickQueue console variable.
Developers should be aware that changing CVarAllowConcurrentQueue at runtime will affect the tick queuing behavior immediately. This could potentially cause issues if not properly managed.
Best practices for CVarAllowConcurrentQueue include:
- Avoid changing its value frequently during gameplay.
- If dynamic changes are necessary, ensure all systems dependent on tick behavior can handle the change gracefully.
- Use it in conjunction with performance profiling tools to understand its impact on your game’s performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TickTaskManager.cpp:50
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarAllowConcurrentQueue(
TEXT("tick.AllowConcurrentTickQueue"),
1,
TEXT("If true, queue ticks concurrently."));
static TAutoConsoleVariable<int32> CVarAllowAsyncTickDispatch(
TEXT("tick.AllowAsyncTickDispatch"),
0,
#Associated Variable and Callsites
This variable is associated with another variable named CVarAllowConcurrentQueue
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TickTaskManager.cpp:49
Scope: file
Source code excerpt:
TEXT("Used to control async component ticks."));
static TAutoConsoleVariable<int32> CVarAllowConcurrentQueue(
TEXT("tick.AllowConcurrentTickQueue"),
1,
TEXT("If true, queue ticks concurrently."));
static TAutoConsoleVariable<int32> CVarAllowAsyncTickDispatch(
TEXT("tick.AllowAsyncTickDispatch"),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TickTaskManager.cpp:1496
Scope (from outer to inner):
file
class class FTickTaskManager : public FTickTaskManagerInterface
function virtual void StartFrame
Source code excerpt:
if (!FTickTaskSequencer::SingleThreadedMode())
{
bConcurrentQueue = !!CVarAllowConcurrentQueue.GetValueOnGameThread();
}
#endif
if (!bConcurrentQueue)
{
int32 TotalTickFunctions = 0;