Warning: Undefined array key "rcommentid" in /storage/content/56/1004556/automon.killarneyonline.eu/public_html/wp-content/plugins/wp-recaptcha/wp-recaptcha.php on line 573

Serial Thread Priority

After adding the dials for representing sensors in a more graphical way, random serial I/O problems occured resulting in incorrect figures being obtained.

The solution was to increase the priority of the serial I/O thread to higher than the rest. By default it inherits the same priority from the calling thread but this isn’t enough.
I started my thead with the QThread::TimeCriticalPriority enumerated type. This seems to have solved the problem. If I discover any more problems, i will attempt setting the whole processor priority higher using the Linux nice command.

The QT Thread priority types are:

QThread::IdlePriority 0 scheduled only when no other threads are running.
QThread::LowestPriority 1 scheduled less often than LowPriority.
QThread::LowPriority 2 scheduled less often than NormalPriority.
QThread::NormalPriority 3 the default priority of the operating system.
QThread::HighPriority 4 scheduled more often than NormalPriority.
QThread::HighestPriority 5 scheduled more often than HighPriority.
QThread::TimeCriticalPriority 6 scheduled as often as possible.
QThread::InheritPriority 7 use the same priority as the creating thread. This is the default.
Wednesday, March 11th, 2009 QT Embdedded Programming, Single Board Computer

Leave a Reply

Warning: Undefined variable $user_ID in /storage/content/56/1004556/automon.killarneyonline.eu/public_html/wp-content/themes/decoder/comments.php on line 55

You must be logged in to post a comment.