Commit Graph

25 Commits

Author SHA1 Message Date
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
andriy tylychko
e298b9779c Tasks: removed invalid verify as it's triggered in an valid case:
Thread1 can call TaskEvent.Trigger(), which unlocks the task, and before it calls verify(TryExecute()), Thread2 starts TaskEvent retraction (because Thread2 started waiting on its subsequent task), and first it gets execution permission. then it proceeds to complete retraction as the task is unlocked but not executed yet. Now Thread1 tries to get execution permissions and fails, but can proceed as normal. its job is done

[FYI] devin.doucette

#ROBOMERGE-AUTHOR: andriy.tylychko
#ROBOMERGE-SOURCE: CL 17770492 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v881-17767770)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0

[CL 17770496 by andriy tylychko in ue5-release-engine-test branch]
2021-10-11 05:54:02 -04:00
johan torp
3f3c413f23 Core constexprification pass to reduce code bloat, improve performance and simplify searching for non-constexpr constants
#rb steve.robb
#jira FORT-412107

#ROBOMERGE-AUTHOR: johan.torp
#ROBOMERGE-SOURCE: CL 17679994 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v875-17642767)

[CL 17680001 by johan torp in ue5-release-engine-test branch]
2021-09-30 13:05:39 -04:00
andriy tylychko
3520cd8043 Tasks: releasing TaskBody functor after its execution as it can contain captured resources messing with their lifetimes
#jira UE-125205

#ROBOMERGE-AUTHOR: andriy.tylychko
#ROBOMERGE-SOURCE: CL 17455132 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v870-17433530)
#ROBOMERGE[bot1]: emt

[CL 17455326 by andriy tylychko in ue5-release-engine-test branch]
2021-09-08 05:14:31 -04:00
andriy tylychko
017327ca13 fixed non-unity compilation
#ROBOMERGE-SOURCE: CL 17328409 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17328414 by andriy tylychko in ue5-release-engine-test branch]
2021-08-26 19:44:13 -04:00
andriy tylychko
dae54b33cd Tasks: moved waiting logic one level down to Private::FTaskBase so when users need fine control of task lifetime, they can use Private::FTaskBase and have full functionality. Planned to be used by Oodle integration.
#ROBOMERGE-SOURCE: CL 17328156 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17328175 by andriy tylychko in ue5-release-engine-test branch]
2021-08-26 19:12:21 -04:00
andriy tylychko
d7b45a28dc Tasks: traced waiting, plus a minor refactoring
#ROBOMERGE-SOURCE: CL 17318026 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v861-17282326)

[CL 17318048 by andriy tylychko in ue5-release-engine-test branch]
2021-08-26 10:48:23 -04:00
andriy tylychko
7dd0c4a68a Tasks: fixed 3 races in nested tasks and deep retraction
#jira UE-121724
#jira UE-121838
#jira UE-121835

#ROBOMERGE-SOURCE: CL 17274758 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v858-17259218)

[CL 17274793 by andriy tylychko in ue5-release-engine-test branch]
2021-08-23 15:36:34 -04:00
andriy tylychko
d4ee588cd5 fixed mac editor compilation
#jira UE-121908

#ROBOMERGE-SOURCE: CL 17268718 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v858-17259218)

[CL 17268739 by andriy tylychko in ue5-release-engine-test branch]
2021-08-23 12:33:47 -04:00
andriy tylychko
e7e8046bc0 Tasks: deep retraction - a retraction that follows task dependencies (prerequisites and nested tasks). When a task is waited for and it's blocked by dependencies, the dependencies will be tried to be retracted first.
#ROBOMERGE-SOURCE: CL 17174771 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)

[CL 17174774 by andriy tylychko in ue5-release-engine-test branch]
2021-08-16 07:08:36 -04:00
andriy tylychko
e75345fc8f Tasks System: nested tasks
A nested task is a task that must be completed before its parent task is completed, w/o blocking a worker that executes the parent task. It's an analog to `DontCompleteUntil` feature of the old TaskGraph

#rb Francis.Hurteau Danny.Couture

#ROBOMERGE-SOURCE: CL 17014883 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v839-17012307)

[CL 17014884 by andriy tylychko in ue5-release-engine-test branch]
2021-08-02 07:12:15 -04:00
andriy tylychko
b82354a1d6 Tasks:
* refactored integration with low-level tasks to fix task retraction: high-level tasks now store task body because there's no way to store it in low-level task and to implement retraction
* added timeout support for task retraction
* removed tests that deadlocks with task retraction

#rb francis.hurteau danny.couture

#ROBOMERGE-SOURCE: CL 16938828 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16938834 by andriy tylychko in ue5-release-engine-test branch]
2021-07-23 13:14:58 -04:00
andriy tylychko
9b88a6b979 implemented sleeping waiting for Tasks (the new system), made it the default option while BusyWait is still available as an opt-in. this doesn't touch TaskGraph or ThreadPool. also happens to fix UE-117431 as it was caused by busy waiting on Audio pipe
#jira UE-117431
#rb francis.hurteau danny.couture

#ROBOMERGE-SOURCE: CL 16638950 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v831-16623017)

[CL 16638967 by andriy tylychko in ue5-release-engine-test branch]
2021-06-11 06:30:54 -04:00
andriy tylychko
c801c1189a tasks dependencies:
* an ability to specify task prerequisites, either TTask or FTaskEvent
* redesigned FTaskEvent so it can be used as a prerequisite
* a helper function `Tasks::Prerequisites()` to specify multiple prerequisites
* added `Tasks::Wait()` function to wait for multiple tasks
* unit- and perf-tests

#rb danny.couture

#ROBOMERGE-SOURCE: CL 16333765 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16333773 by andriy tylychko in ue5-release-engine-test branch]
2021-05-14 15:41:47 -04:00
andriy tylychko
c4f9f0e87b Tasks: inline task priority. There's a special kind of tasks that serve as synchronisation primitives, like FTaskEvent, tasks that are used as a join point of other tasks or tasks that are used to wait for other tasks. Such tasks are lightweight and latency-sensitive. Inline task priority allows these tasks to skip scheduling and be executed "inline" as soon as they are unlocked.
#rb arne.schober francis.hurteau

#ROBOMERGE-SOURCE: CL 16329549 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16329580 by andriy tylychko in ue5-release-engine-test branch]
2021-05-14 10:35:00 -04:00
andriy tylychko
6fb540fb08 TaskTraces for the new TaskGraph API
WIP

[FYI] catalin.dragoiu

#ROBOMERGE-SOURCE: CL 16328386 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16328399 by andriy tylychko in ue5-release-engine-test branch]
2021-05-14 07:45:45 -04:00
Arne Schober
bb8f86fea1 U5 - Remove controversal TryCancelAndLaunchContinuation in favor of just rolling all that functionallity into TryCancel as the Scheduler is not used anymore since an optimization where we run the Continuation inline in case the Task has not yet been launched. Also added TryExecute for cases where one just wants to run the Task inline and it will be executed if it has not yet been launched.
[CL 16223380 by Arne Schober in ue5-main branch]
2021-05-06 13:34:32 -04:00
Andriy Tylychko
d73a076897 added FTask alias for TTask<void>, for convenience as it's expected to be the majority of cases
[CL 16049773 by Andriy Tylychko in ue5-main branch]
2021-04-19 08:40:23 -04:00
Andriy Tylychko
0b5e21f6b0 fixed unresolved symbol (Tasks::FPipe::IsInContext()) detected by local changes
[CL 15845201 by Andriy Tylychko in ue5-main branch]
2021-03-27 17:27:13 -04:00
Andriy Tylychko
e8186c905d added Tasks::FPipe::IsInContext() to check if the current call is in pipe's execution context
added Tasks::FPipe::WaitUntilEmpty() to wait for the last piped task completion

[CL 15844646 by Andriy Tylychko in ue5-main branch]
2021-03-27 10:49:15 -04:00
Andriy Tylychko
327a94d1a4 StatsThread replaced by a Pipe:
* the thread was removed and its surrounding was cleaned up a bit
* ENamedThreads::StatsThread (and relatives) deprecated
* support for single-threaded execution looks a bit messy because it still have to be based on the old TaskGraph API until we convert the game thread to the new API (which will be one of the very last things)
* despite the direct usage of ENamedThreads::StatsThread from an external code is highly unlikely, to preserve backward compatiblity internally TaskGraph redirects all remaining stats tasks to StatsPipe

#rb martin.ridgers

[CL 15794122 by Andriy Tylychko in ue5-main branch]
2021-03-24 04:47:07 -04:00
Andriy Tylychko
ee8895bf60 fixed non-unity build
#jira UE-111186

[CL 15746460 by Andriy Tylychko in ue5-main branch]
2021-03-19 08:29:45 -04:00
Andriy Tylychko
78798abef2 fixed "Compile ClangEditor Win64"
#jira UE-110819

[CL 15724294 by Andriy Tylychko in ue5-main branch]
2021-03-17 11:04:33 -04:00
Andriy Tylychko
d8159b879a compilation fix for NonUnity Compile UnrealGame Android
#jira UE-110813

[CL 15712184 by Andriy Tylychko in ue5-main branch]
2021-03-16 12:12:50 -04:00
Andriy Tylychko
5cada42a4e Tasks: pipe implementation incompatible with old TaskGraph API. Implemented directly over LowLevelTasks.
Pipe is a chain of tasks that are executed one after another and so can be used for synchronised access to a shared resource. Should be used instead of dedicated threads as much as possible.

#rb steve.robb arne.schober

[CL 15700278 by Andriy Tylychko in ue5-main branch]
2021-03-15 16:47:30 -04:00