[Development] Evolving Qt's multithreading API

Thiago Macieira thiago.macieira at intel.com
Wed Feb 20 20:00:38 CET 2013


On quinta-feira, 21 de fevereiro de 2013 02.43.35, Sze Howe Koh wrote:
> On 21 February 2013 00:29, Robert Knight <robertknight at gmail.com> wrote:
> > One other thing - QtConcurrent::run(), QRunnable and invokeMethod() do not
> > provide any standard mid-task cancellation mechanism, which I've found to
> > be a very common need in the context of a client app which is offloading
> > a chunk of heavy work to background threads to avoid UI lag - eg. file
> > operations, parsing.  QFuture provides a cancel() method and a QThread's
> > event loop can be quit between processing events but these only work
> > between task execution.
> 
> Yes, C++ doesn't provide a way to interrupt a function block (there
> wouldn't be a safe way to do so, anyway). The onus is on the
> programmer to split their code into chunks/tasks, be it at a low level
> (threading primitives) or high level (task-oriented programming)

Some people I talked to say that C++1y should solve this by crystallising the 
GCC quasi-solution: C++ exceptions thrown from POSIX cancellation points are 
used to unwind the stack.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130220/140d42bb/attachment.sig>


More information about the Development mailing list