Commit Graph

10 Commits

Author SHA1 Message Date
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
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
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
Andriy Tylychko
da1c205d6b Tasks: fixed 3 races in nested tasks and deep retraction
#jira UE-121724
#jira UE-121838
#jira UE-121835

[CL 17274758 by Andriy Tylychko in ue5-main branch]
2021-08-23 15:35:01 -04:00
Andriy Tylychko
75857300c5 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.
#rb francis.hurteau danny.couture
#jira UE-117548

[CL 17174771 by Andriy Tylychko in ue5-main branch]
2021-08-16 07:08:10 -04:00
Andriy Tylychko
bece60aa3e 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

[CL 17014883 by Andriy Tylychko in ue5-main branch]
2021-08-02 07:11:50 -04:00
Andriy Tylychko
3da5ad97a6 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

[CL 16333765 by Andriy Tylychko in ue5-main branch]
2021-05-14 15:40:51 -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
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