[Qt-interest] QThreads not running in parallel

Jothy jothybasu at gmail.com
Tue Oct 11 10:46:31 CEST 2011


Neither this works

thread1->start()
thread2->start()

thread1->wait()
thread2->wait()


Thanks

Jothy

On Mon, Oct 10, 2011 at 8:55 PM, Thiago Macieira <thiago at kde.org> wrote:

> On Monday, 10 de October de 2011 20:20:43 Jothy wrote:
> > Hi all,
> >
> > I am running several (8) QThreads in the following sequence, but it
> doesn't
> > seem to run in parallel. Only 3/4 are executed at once.
> >
> > thread1->start(Qt::HighestPriority);
> > thread1->wait();
> > .
> > .
> > .
> > .
> > .
> > .
> > .
> > thread8->start(Qt::HighestPriority);
> > thread8->wait();
> >
> >
> > What's the problem?
>
> The design of your code.
>
> You designed it to *wait* for the thread to exit before starting the next.
> So
> it will run at most two at a time: the main thread and the one you started.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>   Software Architect - Intel Open Source Technology Center
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>


-- 
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111011/de1ab447/attachment.html 


More information about the Qt-interest-old mailing list