Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124546

Thread/Application Quality of Service API

    XMLWordPrintable

Details

    • Epic
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Core: Other, Core: Threads
    • None
    • Task Quality of Service API
    • All

    Description

      With heterogeneous processors operating systems have also gotten new APIs beyond the default "low", "medium", "high", etc priority settings for a thread/application.

      With that some changes have come to other projects' task/thread priority model. E.g. chromium now uses more abstract ways of describing their task rather than the "low" to "realtime" priority.

      For example it has "Best effort", which is very unimportant but should be done at some point, and "User blocking" which is used when it's in response to something the user has done and is wait for a result from.

      So this might be a point to reconsider the QThread::Priority model, given that a thread could have a "normal" priority, but still be completely fine if it is mostly relegated to a "efficiency" core.
      One problem for us as a generic framework is defining what entries we would have in the task type / QoS selection, and what it should mean.

      For example, the HTTP thread in QNetworkAccessManager doesn't and shouldn't need to prioritized above anything else, so could run at a "utility thread" level. Which might map to "use whatever core, but set Below Normal priority". While the WatchDog thread in Testlib could be a "Background thread" level, which could map to "prefer efficiency core, run at low priority".

      The ultimate end-goal would be having a way to set a priority/QoS level for your thread/task that accurately describes what it is meant to do, and that it is then hinted to the OS accurately how it should be scheduled.
      It should, in the beginning, just be a separate switch from Priority, but would ultimately override it. And eventually we could drop the QThread::Priority enum in preference for whatever this replacement is.

       

      [0] https://learn.microsoft.com/en-us/windows/win32/procthread/quality-of-service 

      [1] https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/PrioritizeWorkAtTheTaskLevel.html

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              manordheim Mårten Nordheim
              manordheim Mårten Nordheim
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes