QtCS2024 TaskTree

From Qt Wiki
Revision as of 19:22, 6 September 2024 by Jkobus (talk | contribs) (Update)
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.

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) don't relate to this module.
  • What Qt modules the TaskTree depends on?
    • The TaskTree itself depends only on QtCore. The custom tasks depend on modules they come from. E.g.: NetworkQuery task depend 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.