New submission from Ronald Oussoren <ronaldousso...@mac.com>:

Arm based Mac systems have several types of cores: performance cores and 
efficiency cores.  The system has no way to directly specify which core a 
particular proces or thread uses, but programs can use an API for setting the 
QOS class of a thread that will influence which type of core a proces is 
scheduled on.

The primary use case for this would be to select a lower QOS class for 
background tasks to ensure that those minimally impact interactive code.

It would be nice to expose this functionality in Python.


One way to do this is to expose two or three new APIs:

0. Expose an enum.IntEnum on macOS for the various QOS classes

1. An API for setting the QOS class of a particular thread (which could also be 
used to change that class for the main thread), for example a read/write 
property ``threading.Thread.qos_class``

2. A new keyword argument ``qos_class`` to ``threading.Thread.__init__()``

3. Optional: an API for setting changing the default value for that new keyword 
argument

The new API would only exist on macOS.

One consideration: This is a platform specific option, in my limited research I 
haven't found an easy way to accomplish similar results on Linux or Windows.

Background information: 
https://developer.apple.com/documentation/apple-silicon/tuning-your-code-s-performance-for-apple-silicon

----------
components: Interpreter Core, macOS
messages: 415538
nosy: ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: thread QOS attribute on macOS
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue47064>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to