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. Does qt have library to change windows or other os process priority?
Forum Updated to NodeBB v4.3 + New Features

Does qt have library to change windows or other os process priority?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.0k Views 2 Watching
  • 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
    Q139
    wrote on last edited by Q139
    #1

    Does qt have library to change windows or other os process priority?
    Like setting it in task manager to low so that high cpu usage multithreaded program wont slow all other processes.

    kshegunovK 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      No Qt doesn't provide that. It's out of its scope.

      If you want to do such things you'll have to search for native APIs.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Q139
        wrote on last edited by Q139
        #3

        Windows libs https://msdn.microsoft.com/en-us/library/windows/desktop/ms686277(v=vs.85).aspx

        if(low){
        SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
        }else{
        SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL);
        }

        1 Reply Last reply
        0
        • Q Q139

          Does qt have library to change windows or other os process priority?
          Like setting it in task manager to low so that high cpu usage multithreaded program wont slow all other processes.

          kshegunovK Offline
          kshegunovK Offline
          kshegunov
          Moderators
          wrote on last edited by kshegunov
          #4

          @Q139
          You can also try this (windows only):

          QCoreApplication::thread()->setPriority(QThread::NormalPriority);
          

          But thread priority is very different from process priority.
          https://msdn.microsoft.com/en-us/library/windows/desktop/ms686219(v=vs.85).aspx

          Read and abide by the Qt Code of Conduct

          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