[Qt-interest] QThread::sleep versus QThread::wait

James Matta jamesmatta at gmail.com
Tue Feb 2 21:53:34 CET 2010


I am writing a program that uses one thread to read data out of a series of
files and push it onto a queue, and then multiple other threads to process
the data.
I would like to set things up so that if the event queue grows too large the
reading thread pauses in execution so that the processing threads can catch
up.
My first instinct was to simply use QThread::msleep or QThread::usleep;
however, as I was reading the documentation I noticed the QThread::wait
function and thought that perhaps that would work, however the description
for QThread::wait is confusing me a bit. Can anybody clarify the differences
and perhaps give a suggestion as to which I should use?
--
James T Matta
University of Notre Dame
Physics Department

"Those who make you believe absurdities, can make you commit atrocities."
-Voltaire
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100202/07a301b8/attachment.html 


More information about the Qt-interest-old mailing list