[Qt-interest] Demo Browser and Qt::Concurrent query
Thiago Macieira
thiago at kde.org
Wed Jan 20 08:55:45 CET 2010
Em Quarta-feira 20 Janeiro 2010, às 08:17:45, Nitin Mahajan escreveu:
> > You're using a QNetworkReply object from a thread that it
> > doesn't belong to
> > (that's not allowed) and you're doing GUI operations from a
> > thread, which is
> > also not allowed.
> >
> > You can open a file and write to it in a thread. But you
> > may not do GUI and you
> > may not read from the QNetworkReply in it.
>
> Thanks for the inputs. Suppose I decide to do only the file write(No
> reading from QNetworkReply or No GUI ops) operation in a separate thread,
> in this particular case, Whether spawning of threads very frequently would
> also result into overhead and inturn GUI drawing in main thread becomes
> slow?
Yes, the spawning of threads can be a slow / costly operation. It depends on
what operating system you're running, though.
QtConcurrent uses QThreadPool, which means it will reuse existing threads and
avoid spawning new.
In any case, what kind of network connection will you be on that you can
download fast enough for disk I/O to be a bottleneck?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100120/db72989f/attachment.bin
More information about the Qt-interest-old
mailing list