QtCS2024 TaskTree

From Qt Wiki
Revision as of 15:37, 28 September 2024 by Jkobus (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Session Summary

TaskTree (https://wiki.qt.io/TaskTree) is a solution for automatic management of asynchronous tasks. It is used in many places inside QtCreator. The first non-Creator usage is AssetDownloader (shared among many Qt examples) for the upcoming Qt 6.8 release. The presentation shows in more details what this solution is about, how you may start using it and a short description about new task tree functionalities added recently.

The presentation used on Qt Contributor Summit '24, Würzburg, 6 Sep 2024.

Presentation '24

Session Owners

Jarek Kobus

Notes

A brief presentation of the TaskTree, including recently added features like logical operators, conditional expressions and for loops.

There were quite a lot of interesting questions asked:

  • Is it possible to run the TaskTree recursively?
    • It's possible to nest TaskTree inside the task tree recipe and setup the nested task tree dynamically.
  • What's the relation to the QtConcurrent module?
    • Only the ConcurrentCallTask is related to this module, other task types (e.g. QProcess or NewtorkQuery) and task tree itself don't relate to this module.
  • What Qt modules the TaskTree depends on?
    • The TaskTree itself depends only on QtCore. Custom tasks depend on modules they come from. E.g.: NetworkQuery task depends on QtNetwork module, and so on.
  • What's the magic behind the conditional expressions implementation?
    • Implicit intermediate (temporary) objects.
  • Is it possible to start 2 tasks working together like a pipe?
    • Yes, there are cases like that in Creator - we use a helper BarrierTask which holds the execution of a group until the barrier is passed. The barrier is passed when it's advanced - and this may be done from any other running task.

There was also a feedback that the solution seems useful and it's worth to start thinking about having it as a part of Qt.