[Interest] Reusing QRunnable objects

John Lee jjl at pobox.com
Mon Jul 15 01:50:54 CEST 2013


The documentation for QRunnable and QThreadPool leaves me unsure how I may 
reuse a QRunnable object.

The docs say:

http://qt-project.org/doc/qt-5.1/qtcore/qrunnable.html

QThreadPool supports executing the same QRunnable more than once by 
calling QThreadPool::tryStart(this) from within the run() function.


I initially read this to imply that one may *only* reuse a QRunnable in 
that way.  Is that true?  It *seems* to work fine to reuse them by calling 
QThreadPool's start method more than once.  Am I storing up trouble by 
doing that?  Do I need to ensure that only one is running at a time?

What restrictions are there?  My QRunnables have autoDelete disabled.  I 
am using a single thread pool.

Thanks


John



More information about the Interest mailing list