OSS.DelayAsyncTaskOutQueue
OSS.DelayAsyncTaskOutQueue
#Overview
name: OSS.DelayAsyncTaskOutQueue
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Min total async task time\nTime in secs
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of OSS.DelayAsyncTaskOutQueue is to control the delay time for finalizing tasks in the out queue of the Online Subsystem’s async task manager. This setting is primarily used for debugging and performance tuning purposes.
This setting variable is utilized by the Online Subsystem module, specifically within the async task management system. Based on the callsites, it’s clear that this variable is part of the Online Subsystem plugin, which handles various online functionalities in Unreal Engine.
The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable with a default value of 0.0f, meaning no delay by default. Developers can modify this value at runtime through console commands or configuration files.
The associated variable CVarDelayAsyncTaskOutQueue interacts directly with OSS.DelayAsyncTaskOutQueue. They share the same value and purpose. CVarDelayAsyncTaskOutQueue is used to retrieve the current value of the delay time in the game thread.
Developers must be aware that this variable is only used in non-shipping builds (#if !UE_BUILD_SHIPPING). It’s intended for debugging and performance testing, not for use in final released games. Modifying this value will affect the timing of async task completion in the Online Subsystem, which could impact the responsiveness and behavior of online features.
Best practices when using this variable include:
- Use it only for debugging and performance tuning purposes.
- Be cautious when increasing the delay, as it may negatively impact the user experience.
- Always reset it to 0.0f before building for release.
- Document any non-zero values used during development to help track down timing-related issues.
Regarding the associated variable CVarDelayAsyncTaskOutQueue:
The purpose of CVarDelayAsyncTaskOutQueue is to provide a convenient way to access and modify the OSS.DelayAsyncTaskOutQueue value within the C++ code of the Online Subsystem module.
This variable is used directly in the FOnlineAsyncTaskManager::GameTick function to retrieve the current delay value. It’s part of the Online Subsystem module and is crucial for controlling the timing of async task processing.
The value of CVarDelayAsyncTaskOutQueue is set when the OSS.DelayAsyncTaskOutQueue console variable is modified. They are effectively two interfaces to the same underlying value.
Developers should be aware that modifying CVarDelayAsyncTaskOutQueue will affect the behavior of the async task manager. It’s important to use this variable consistently with OSS.DelayAsyncTaskOutQueue and to be mindful of its impact on the Online Subsystem’s performance.
Best practices for CVarDelayAsyncTaskOutQueue include:
- Use GetValueOnGameThread() to access its value, as shown in the provided code.
- Avoid modifying it directly in code; instead, use the console variable system to change its value.
- Consider wrapping access to this variable in debug-only code to ensure it’s not accidentally used in shipping builds.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystem/Source/Private/OnlineAsyncTaskManager.cpp:14
Scope (from outer to inner):
file
namespace OSSConsoleVariables
Source code excerpt:
/** Time to delay finalization of a task in the out queue */
TAutoConsoleVariable<float> CVarDelayAsyncTaskOutQueue(
TEXT("OSS.DelayAsyncTaskOutQueue"),
0.0f,
TEXT("Min total async task time\n")
TEXT("Time in secs"),
ECVF_Default);
}
#endif
#Associated Variable and Callsites
This variable is associated with another variable named CVarDelayAsyncTaskOutQueue
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystem/Source/Private/OnlineAsyncTaskManager.cpp:13
Scope (from outer to inner):
file
namespace OSSConsoleVariables
Source code excerpt:
{
/** Time to delay finalization of a task in the out queue */
TAutoConsoleVariable<float> CVarDelayAsyncTaskOutQueue(
TEXT("OSS.DelayAsyncTaskOutQueue"),
0.0f,
TEXT("Min total async task time\n")
TEXT("Time in secs"),
ECVF_Default);
}
#Loc: <Workspace>/Engine/Plugins/Online/OnlineSubsystem/Source/Private/OnlineAsyncTaskManager.cpp:175
Scope (from outer to inner):
file
function void FOnlineAsyncTaskManager::GameTick
Source code excerpt:
#if !UE_BUILD_SHIPPING
const float TimeToWait = OSSConsoleVariables::CVarDelayAsyncTaskOutQueue.GetValueOnGameThread();
#endif
do
{
Item = nullptr;
// Grab a completed task from the queue