I have updated the patch here to add some minimal API to QThread:
https://codereview.qt-project.org/c/qt/qtbase/+/593378

Should also do QThreadPool when I think about it.

Please give feedback, thanks,
Mårten

From: Tor Arne Vestbø <tor.arne.ves...@qt.io>
Sent: fredag 27. september 2024 12:54
To: Mårten Nordheim <marten.nordh...@qt.io>
Cc: Volker Hilsheimer <volker.hilshei...@qt.io>; development@qt-project.org
Subject: Re: [Development] Thread / Process Quality of Service APIs in Qt




On Sep 27, 2024, at 12:49, Mårten Nordheim via Development 
<development@qt-project.org<mailto:development@qt-project.org>> wrote:




-----Original Message-----
From: Volker Hilsheimer 
<volker.hilshei...@qt.io<mailto:volker.hilshei...@qt.io>>
Sent: torsdag 26. september 2024 17:18
To: Mårten Nordheim <marten.nordh...@qt.io<mailto:marten.nordh...@qt.io>>; 
development@qt-
project.org<http://project.org/>
Subject: Re: [Development] Thread / Process Quality of Service APIs in Qt




On 24 Sep 2024, at 23:23, Mårten Nordheim via Development
<development@qt-project.org<mailto:development@qt-project.org>> wrote:


Hello,

For a while now there has been "Quality of Service" APIs available for
threads and processes in at least Apple and Windows.

Typically you can request either "Eco", and Default (i.e. the OS does its
normal thing)


[...]

Thanks,
Mårten


Based on my interpretation, I think we can start with a low-level but dirt-
simple API that allows applications set a preferred CPU core type (e.g. Eco vs
Default) on which a thread might run, together with the existing thread
priority.

Coupling thread priority and preferred CPU type into a “task type” or “load
category” as a convenient, higher-level abstraction can be a follow-up,
utilising the former lower-level API. Good naming of those seems hard; I’d
stay away from domain specific task type names like “AudioProcessing”.

Not sure if it’s useful to have a QCoreApplication API in addition to a QThread
API; I’d expect that calling the static QThread setters from main() would be the
same as calling the QCoreApplication setter.

Volker

On Windows there is an API for setting it on the process-level. And I thought
there was one for macOS as well, but it seems to be more focused on labelling
the workloads that the application is doing, rather than labelling the whole
application. So, thread-specific is a safe choice.

Sounds good. A minimal API for the QoS seems like a good start in any case, 
even if we later decide on a higher level “workload” categorization API.

Tor Arne

-- 
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to