[Qt-interest] QThread reinitialization

Tim W timpie.w at gmail.com
Fri Jun 5 18:20:28 CEST 2009


>Yes, it is. Both pthread and Win32 threads cannot be restarted, so QThread
>will create new OS threads each time start() is called

Is it the same for the thread pool and QtConcurrent functions?

Cheers,
Tim

--
An Apple a day keeps Windows away

ACCU - http://www.accu.org - Professionalism in Programming.


On Fri, Jun 5, 2009 at 10:18 AM, Bradley T. Hughes <bradley.hughes at nokia.com
> wrote:

> Ingomar Wesp wrote:
> >>> I have a question regarding QThread. Let say we have a QThread object.
> >>> We start the thread. After the run() method finishes, can we again call
> >>> the "start()" method ? Or we have to create a new object and then start
> >>> the method again.
> >> Calling start() again is perfectly possible.
> >
> > Just curious: Is the underlying (native) thread destroyed when the run()
> > method terminates? That is: Does calling start() again require a new
> native
> > thread to be created (and is thus expensive in terms of performance)?
>
> Yes, it is. Both pthread and Win32 threads cannot be restarted, so QThread
> will create new OS threads each time start() is called.
>
> --
> Bradley T. Hughes (Nokia-D-Qt/Oslo), bradley.hughes at nokia.com
> Sandakervn. 116, P.O. Box 4332 Nydalen, 0402 Oslo, Norway
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090605/aa6ae8e7/attachment.html 


More information about the Qt-interest-old mailing list