On quinta-feira, 21 de fevereiro de 2013 02.43.35, Sze Howe Koh wrote:
> On 21 February 2013 00:29, Robert Knight <[email protected]> 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

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to