Home:ALL Converter>Custom scheduling of threads in Qt application

Custom scheduling of threads in Qt application

Ask Time:2013-03-11T03:36:12         Author:lorefnon

Json Formatter

I am a new-comer to Qt and would like to know about recommended approaches towards custom scheduling of threads managed by QThread instances.

I would like to have a scheduler thread which, in response to change in application state, puts certain threads to sleep or changes their priority. The scheduling should be preemptive as in I should be able to put to sleep certain workers (which may be waiting on a mutex) and invoke them later.

What I am particularly curious about is why the QThread::sleep and related functions are protected ?

If the kind of fine grained control over scheduling can't be obtained through Qt threading classes then I would like to know about alternative possibilities.

Author:lorefnon,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/15326595/custom-scheduling-of-threads-in-qt-application
yy