[Development] QPromise cancellation
Ivan Solovev
ivan.solovev at qt.io
Fri Jan 30 11:38:20 CET 2026
Hi Arno,
> This was easier than expected. QFutures are already linked in a
> doubly-linked list. Once the inner future is available, we just have to
> relink the chain elements.
Thanks for pushing the patch. I commented on the change.
The approach works for simple cases (which are maybe most common).
However, I do not know how to make it reliably work in a general case.
Best regards,
Ivan
________________________________________
From: Development <development-bounces at qt-project.org> on behalf of Arno Rehn <a.rehn at menlosystems.com>
Sent: Friday, January 30, 2026 9:15 AM
To: development at qt-project.org
Subject: Re: [Development] QPromise cancellation
On 28.01.2026 13:00, Arno Rehn wrote:
> On 28.01.2026 12:37, Ivan Solovev wrote:
>> I must admit that I did not look at the CallOutInterface when trying to
>> solve the problem. So, I'd be interested to have a look at a WIP patch.
>> Maybe we could find a way to fit it nicely into the implementation.
>> Even though in general I agree that QFuture internals are already
>> too complicated.
>
> I'll come up with something, but likely not today anymore. Tracking
> lifetimes across the implicitly shared state is gonna be... "fun".
>
> OTOH, maybe we can unify some of the continuation/CallOutInterface stuff
> while we're at it. Only
https://codereview.qt-project.org/c/qt/qtbase/+/708578
This was easier than expected. QFutures are already linked in a
doubly-linked list. Once the inner future is available, we just have to
relink the chain elements.
In a similar way we can propagate this to the inner futures of whenAll()
and whenAny(), just that the doubly-linked list then becomes a tree.
Cheers,
Arno
--
Arno Rehn
Principal Software Engineer
Tel +49 89 189 166 0
Fax +49 89 189 166 111
a.rehn at menlosystems.com
http://www.menlosystems.com/
Menlo Systems GmbH
Bunsenstrasse 5, D-82152 Martinsried, Germany
Amtsgericht München HRB 138145
Geschäftsführung: Dr. Michael Mei, Dr. Ronald Holzwarth
USt.-IdNr. DE217772017, St.-Nr. 14316170324
--
Development mailing list
Development at qt-project.org
https://lists.qt-project.org/listinfo/development
More information about the Development
mailing list