How qthread get executed based on priority ?
-
i want know if
qthread priority has lowest number value then it will get chance first or it get chance to get executed at last ?
can anybody explain its priority better way ?
-
i want know if
qthread priority has lowest number value then it will get chance first or it get chance to get executed at last ?
can anybody explain its priority better way ?
@Qt-embedded-developer
void QThread::setPriority(QThread::Priority priority) takes a enum QThread::Priority. You can the values of theenum
, basically the hight the value the higher the priority. Higher priority theoretically means executed earlier and/or given more CPU slice, though in practice anything can happen. -
-
Yinz are probly already aware of this but I think it is important to note...from the QThread documentation:
The effect of the priority parameter is dependent on the operating system's scheduling policy. In particular, the priority will be ignored on systems that do not support thread priorities (such as on Linux, see http://linux.die.net/man/2/sched_setscheduler for more details).