Qt World Summit: Submit your Presentation

QthreadNotScheduled for sometime

  • Hi all,
    As part of my application, i have Rx thread that connects 'socket-readyRead() signals to a slots those emit signals for main-thread' and thread-timer's timerEvent is defined to do periodic work. Apart from above two threads, Tx thread receives signals from gui-thread to transmit events and has a Qtimer to send application-heart-beat to other applications periodically. Both Rx and Tx timers are of 10ms repeating-timers. Both threads used exec call and started event-loops. But occasionally, Tx thread doesnt get scheduled but rest of the two get. All the 3 threads are completely asynchronous and wake-up on timer-events, ethernet-messages over sockets or signals.

    Only difference between Tx & Rx threads is: Tx thread is given TimeCriticalPriority, has opened sockets to send ethernet messages and uses
    Qtimer object in it. Whereas Rx thread listens on sockets for messages and uses thread-basic-timer.

    By printfs in timerEvent () it was noticed that Tx thread was not scheduled for around 800ms inspite of assigning TimeCriticalPriority..

    Please suggest me any way to make Tx thread more time-responsive.

Log in to reply