Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95273

QFuture::then() documentation about threading is unclear

    XMLWordPrintable

    Details

    • Story Points:
      3
    • Commits:
      d61820e5ab3176818b8a2326fa25d05a9f135244 (qt/qtbase/dev) 2c5de457813124d312858628fe7b9d46c827cf16 (qt/qtbase/6.1) 878b0ce10ed4d83e6da34aea878113e02bb23710 (qt/qtbase/6.2)
    • Sprint:
      Qt6_Foundation_Sprint 39

      Description

      The docs for QFuture::then() say https://doc.qt.io/qt-6/qfuture.html#then :

      Attaches a continuation to this future, allowing to chain multiple asynchronous computations if desired. When the asynchronous computation represented by this future finishes, function will be invoked in the same thread in which this future has been running. If the continuation is attached after the parent has already finished, it will be invoked in the thread where the parent lives. This method returns a new QFuture representing the result of the continuation.

      I'm not sure what "this future has been running". A future does not run on any thread. Does it mean "on the same thread that fulfills the promise associated to this future"?

      Similarly: in "parent has already finished, it will be invoked in the thread where the parent lives", what is meant by "parent" here?

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sonakur Sona Kurazyan
            Reporter:
            peppe Giuseppe D'Angelo
            PM Owner:
            Vladimir Minenko Vladimir Minenko
            RnD Owner:
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes