Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ue-async-threading

БесплатноБез исполняемых скриптовНе проверен

Use when offloading work off the game thread, dispatching results back to it, running data-parallel loops, or scheduling timers and tickers in UE C++. Also…

quodsolerот quodsoler★ 483 звезды на GitHub

Об этом скилле

UE Async and Threading

Target engine: UE 5.8. APIs below are verified against the 5.8 headers; older forms are listed under "Deprecated — do not use".

This skill covers moving work off the game thread and bringing results back: the UE::Tasks system (Tasks/Task.h, Tasks/Pipe.h), Async/TFuture (Async/Async.h, Async/Future.h), thread-pool FAsyncTask (Async/AsyncWork.h), ParallelFor, dedicated FRunnable threads, locks and lock-free queues, FTSTicker and FTimerManager. Everything except timers is in the Core module; FTimerManager is in Engine; ENQUEUE_RENDER_COMMAND is in RenderCore. Build.cs: PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine" }); and add "RenderCore" only when enqueuing render commands.

Context

Read .agents/ue-project-context.md if it exists (module names, conventions, enabled plugins, GAS/networking setup). Do not stop if it is missing.

Identify the area from the request and the codebase. Ask only when two plausible readings would produce different code.

Request is about… Go to
Which API fits Pattern Selection
One-shot background work, chaining, prerequisites, events UE::Tasks
Serializing access to a resource without a dedicated thread FPipe and FTaskConcurrencyLimiter
Futures, promises, dispatch to the game thread Async, TFuture and AsyncTask
Reusable pooled work unit FAsyncTask and FAutoDeleteAsyncTask
Data-parallel loops ParallelFor
Long-lived dedicated thread FRunnable and FRunnableThread
Locks, events, atomics, queues, shared pointers Synchronization
Per-frame callbacks and delayed calls Tickers and Timers
UObject, GC and render-thread rules Thread Safety Rules
Old forms Deprecated — do not use

Threading Model

Thread Check Owns
Game thread IsInGameThread() (CoreGlobals.h) All UObject access, Blueprint, gameplay, timers, tickers
Render thread IsInRenderingThread() Scene proxies, render commands (ENQUEUE_RENDER_COMMAND)
RHI thread IsInRHIThread() GPU command submission
Worker threads none UE::Tasks scheduler, TaskGraph AnyThread, ParallelFor
Thread pools none GThreadPool, GBackgroundPriorityThreadPool, GIOThreadPool; GLargeThreadPool only WITH_EDITOR (Misc/QueuedThreadPool.h)

Golden rule: UObjects are game-thread-only. Compute off-thread on plain data, then apply results on the game thread through a TWeakObjectPtr (see Thread Safety Rules).

Pattern Selection

Need Use Result
One-shot background work, dependencies, chaining UE::Tasks::Launch TTask<T>
Run a lambda on the game thread from anywhere AsyncTask(ENamedThreads::GameThread, ...) none
Future-style result with execution-context choice Async(EAsyncExecution, ...) TFuture<T>
Serialize tasks touching one resource (FIFO) UE::Tasks::FPipe TTask<T>
Cap how many tasks run at once UE::Tasks::FTaskConcurrencyLimiter none
Reusable pooled work unit with owner-managed lifetime FAsyncTask<T> / FAutoDeleteAsyncTask<T> via GetTask()
Data-parallel loop, caller blocks ParallelFor none
Long-lived thread (socket, file watcher, sim loop) FRunnable + FRunnableThread::Create manual
Per-frame callback outside an Actor tick FTSTicker::GetCoreTicker().AddTicker handle
Delayed or repeating call on the game thread FTimerManager::SetTimer FTimerHandle

UE::Tasks

#include "Tasks/Task.h"
// Tasks/Task.h:299
template<typename TaskBodyType>
UE::Tasks::TTask<TInvokeResult_T<TaskBodyType>> Launch(const TCHAR* DebugName, TaskBodyType&& TaskBody,
    ETaskPriority Priority = ETaskPriority::Normal,
    EExtendedTaskPriority ExtendedPriority = EExtendedTaskPriority::None,
    ETaskFlags Flags = ETaskFlags::None);
// Tasks/Task.h:324 — same, with a prerequisites collection as the third parameter
template<typename TaskBodyType, typename PrerequisitesCollectionType>
UE::Tasks::TTask<TInvokeResult_T<TaskBodyType>> Launch(const TCHAR* DebugName, TaskBodyType&& TaskBody,
    PrerequisitesCollectionType&& Prerequisites,
    ETaskPriority Priority = ETaskPriority::Normal,
    EExtendedTaskPriority ExtendedPriority = EExtendedTaskPriority::None,
    ETaskFlags Flags = ETaskFlags::None);
using namespace UE::Tasks;

TArray<int32> Data;
TTask<int32> Sum = Launch(UE_SOURCE_LOCATION, [Data]() { return ComputeSum(Data); });

// Prerequisites: TaskB runs after TaskA completes. Handles are copyable; GetResult() is non-const.
TTask<FVector> TaskA = Launch(UE_S
Полный SKILL.md на GitHub

Установить ue-async-threading в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/thread-safety-guide.mdreferences/threading-patterns.md

FAQ

Что делает скилл ue-async-threading?

Use when offloading work off the game thread, dispatching results back to it, running data-parallel loops, or scheduling timers and tickers in UE C++. Also use when the user mentions 'UE::Tasks::Launch', 'FPipe', 'FTaskEvent', 'AsyncTask', 'Async()', 'TFuture', 'TPromise', 'ParallelFor', 'FRunnable', 'FAsyncTask', 'FCriticalSection', 'FRWLock', 'UE::FMutex', 'TMpscQueue', 'IsInGameThread', 'FTSTicker', 'SetTimer', 'thread safety'. For async asset loading, see ue-data-assets-tables; for smart pointers and GC lifetime, see ue-cpp-foundations.

Как установить скилл ue-async-threading?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ue-async-threading запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ue-async-threading с