[Interest] Qthread from QFuture?

Konstantin Shegunov kshegunov at gmail.com
Wed Jan 5 03:46:29 CET 2022


On Wed, Jan 5, 2022 at 3:03 AM Scott Bloom <scott at towel42.com> wrote:

> Its such a nice simple interface for launching a background thread and
> asynchronously being notified when it finishes 😊
>

The point is that it doesn't start a thread at all, not necessarily. The
threads are pooled and your job is queued for execution. When and on which
thread that happens is beyond your control, nor is it deterministic. It may
happen (almost) immediately or sometime later when the other pending jobs
have been processed. What you want is to kill a thread you don't own - you
haven't started, you don't manage and you don't know when or how it
finishes. Hence Thiago's advice - use QThread if you really *must* kill it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220105/419045cd/attachment.htm>


More information about the Interest mailing list