Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How qthread get executed based on priority ?
QtWS25 Last Chance

How qthread get executed based on priority ?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 186 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by Qt embedded developer
    #1

    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 ?

    JonBJ 1 Reply Last reply
    0
    • Q Qt embedded developer

      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 ?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Qt-embedded-developer
      void QThread::setPriority(QThread::Priority priority) takes a enum QThread::Priority. You can the values of the enum, 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.

      1 Reply Last reply
      2
      • Q Qt embedded developer has marked this topic as solved on
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by
        #3

        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).

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved