[Ctk-developers] workflow framework and threads

Miklos Espak espakm at gmail.com
Mon Oct 24 17:47:11 EDT 2011


>
> By running the step in a different thread, what do you mean exactly ?
>

Sorry, I was not clear. I run some calculations (ITK filters) in the
workflow steps, and I start them in a new thread. The workflow step listens
to the "finished" and "terminated" signal of the thread and it signals
"onExitCompleted" after the thread is finished.


> As a side note: "Although QObject<http://doc.qt.nokia.com/stable/qobject.html>is reentrant, the GUI classes, notably
> QWidget <http://doc.qt.nokia.com/stable/qwidget.html> and all its
> subclasses, are not reentrant. They can only be used from the main thread."
> See http://doc.qt.nokia.com/stable/threads-qobject.html
>

Yes, I had some troubles because of this, but I solved them. I refactored
every GUI access from the function that runs the calculation. E.g. the
thread that runs the calculation notifies the GUI thread through signals
about the progress of the internal ITK filters. In this way the thread does
not need to access the progress bar.

Would it be possible for you to share some code ? May a topic on your CTK
>> fork ?
>>
>
Yes, I will upload a sample app tomorrow.

Thanks,
Miklos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20111024/93b201d4/attachment.html>


More information about the Ctk-developers mailing list