Commit Graph

38 Commits

Author SHA1 Message Date
Marc Audy
25478ced7f Fix non-unity errors
#preflight
#rnx

[CL 20255119 by Marc Audy in ue5-main branch]
2022-05-17 22:01:45 -04:00
Andriy Tylychko
355cb277e8 FTaskPriorityCVar - a console var to configure Tasks System priorities, by analogy with FAutoConsoleTaskPriority for TaskGraph
#preflight 628386e43f6aa88b1a777e76

[CL 20240822 by Andriy Tylychko in ue5-main branch]
2022-05-17 07:43:35 -04:00
Andriy Tylychko
573d2c69a4 fixed task retraction while waiting on named threads. check the new unit test for exact conditions
#rb francis.hurteau
#preflight 627d27784a05ef0394cc3970

[CL 20165251 by Andriy Tylychko in ue5-main branch]
2022-05-12 11:46:49 -04:00
Andriy Tylychko
2ff31a5f77 switched off tasks integration while fixing a bug
#preflight 627af8951e74993343433a50

[CL 20132267 by Andriy Tylychko in ue5-main branch]
2022-05-10 19:59:31 -04:00
Andriy Tylychko
ba0aaed108 Tasks System: minor improvement to deadlock detection. now detects waiting for task completion from inside that task execution, even if inside its inner task.
#preflight 6273b4f91364d1b5cc483ba3

[CL 20056215 by Andriy Tylychko in ue5-main branch]
2022-05-05 07:54:47 -04:00
Andriy Tylychko
b5d5894233 enabled "tasks integration", that replaces the old TaskGraph task implementation by the new Tasks System behind a thin adaptor
#preflight 62724b72d90599edbe2e082c

[CL 20056067 by Andriy Tylychko in ue5-main branch]
2022-05-05 07:08:23 -04:00
Andriy Tylychko
3843ea9667 moved EExtendedTaskPriority from the private to the public Tasks System API. This allows:
1) to use "inline" priority publicly, which is often helpful for perf
2) to use Tasks System with named threads (only if "tasks integration" is enabled - `TASKGRAPH_NEW_FRONTEND`)
#preflight 6271491cfe09c0cfbc3c5b69

[CL 20027004 by Andriy Tylychko in ue5-main branch]
2022-05-03 12:01:34 -04:00
Andriy Tylychko
c98d6ffe3f the fix 17455132 was lost during recent tasks refactoring. reintroducing it
#jira UE-149740
#preflight 6269266a4c094202410b43ac

[CL 19937334 by Andriy Tylychko in ue5-main branch]
2022-04-27 07:34:47 -04:00
Andriy Tylychko
e491fb8f8b tasks integration: Tasks System integrated into the old TaskGraph API as an intermediary step into transition to the new API. Disabled by default. The only remaining part of the old TaskGraph is named threads implementation that is not directly supported by the new Tasks System.
also includes the fix for parallel animation evaluation to work correctly with task retraction that is globally enabled by these change. animation fix was reviewed by evgenii.babinets

#rb francis.hurteau, danny.couture
#preflight 6268163bdd35c0d6cab2c267

[CL 19924083 by Andriy Tylychko in ue5-main branch]
2022-04-26 13:31:54 -04:00
Andriy Tylychko
a14be302ec added TTask::IsAwaitable() to detect if the task can be waited for from the current thread. The only case that is detected right now is a waiting from inside a task that leads to a deadlock. Required by parallel animation evaluation to detect that a code is executed inside a task during task retraction.
#rb francis.hurteau, danny.couture
#preflight 626802fb853fdb6fddbcaa37

[CL 19920343 by Andriy Tylychko in ue5-main branch]
2022-04-26 11:03:40 -04:00
marc audy
006002155d Fix non-unity no-pch issues
#preflight 626180076119a1a496ab2bdf
#rnx

[CL 19852196 by marc audy in ue5-main branch]
2022-04-21 13:34:58 -04:00
Andriy Tylychko
632c0eb23f a workaround for MSVC compiler bug, to make TExecutableTask compile if instantiated inside a lambda. a simplified test: https://godbolt.org/z/ae96c7evn
#preflight 62614bf5360b45c32a8bad20

[CL 19847623 by Andriy Tylychko in ue5-main branch]
2022-04-21 08:41:45 -04:00
Andriy Tylychko
fcdbf6843b Tasks system refactoring and general optimisations:
* tasks store task body by value in place
* pooled task allocation
* FTaskEvent doesn't have a body and is not executed
* basic waiting for a task (w/o timeout) allocates the waiting task on the stack
* optimised internal atomic state and task retraction

#rb francis.hurteau
#preflight https://horde.devtools.epicgames.com/job/625e84b0d412434587e1b740

[CL 19805905 by Andriy Tylychko in ue5-main branch]
2022-04-19 06:03:04 -04:00
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