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. I use QtConcurrent to create threads, how do I set the thread priority?
Forum Updated to NodeBB v4.3 + New Features

I use QtConcurrent to create threads, how do I set the thread priority?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 453 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.
  • firecatF Offline
    firecatF Offline
    firecat
    wrote on last edited by
    #1

    I use QtConcurrent to create threads, how do I set the thread priority?
    m_future_Parking = QtConcurrent :: run (this, & CProduceCore :: threadfun_Parking);

    jsulmJ JonBJ 2 Replies Last reply
    0
    • firecatF firecat

      I use QtConcurrent to create threads, how do I set the thread priority?
      m_future_Parking = QtConcurrent :: run (this, & CProduceCore :: threadfun_Parking);

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @firecat I don't think you can. If you want to set thread priority use QThread

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • firecatF firecat

        I use QtConcurrent to create threads, how do I set the thread priority?
        m_future_Parking = QtConcurrent :: run (this, & CProduceCore :: threadfun_Parking);

        JonBJ Online
        JonBJ Online
        JonB
        wrote on last edited by
        #3

        @firecat
        If you want to do this, it's not so easy
        https://www.qtcentre.org/threads/28065-Control-the-priority-of-QtConcurrent-run()

        See the following for a possibility (nasty):
        https://wiki.qt.io/Set_Thread_Priority_In_QtConcurrent

        1 Reply Last reply
        1

        • Login

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