This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients corona10, ned.deily, ronaldoussoren
Date 2022-03-20.09:09:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647767352.04.0.885977213788.issue47064@roundup.psfhosted.org>
In-reply-to
Content
> For example, using a priority policy that actually uses QOS attribute :)

How would that look? 

The QOS class is already a high level interface that affects a number of low-level polices. The classes are comprehensively documented in sys/qos.h.

In short (my rephrasing and summary of the documentation in sys/qos.h):

* QOS_CLASS_INTERACTIVE

   This QOS class indicates that the work on the thread is interactive with the user.

  
* QOS_CLASS_USER_INITIATED

   This QOS class indicates that work was initiated by the user and the user is likely
   waiting for the result.

   
* QOS_CLASS_DEFAULT

   Default QOS class.

  
* QOS_CLASS_UTILITY

  This QOS class indicates that work may or may not be initiated by the user and the 
  user is unlikely to be waiting for the result.

* QOS_CLASS_BACKGROUND

   This QOS class indicates that the work on this thread was not initiated by the user,
   and the user is not waiting for a result.

Having a python policy object instead of these fixed classes might be more flexible, but tuning those is anything but trivial and exposing such a low-level interface directly to users would likely be too complex for most use cases.  I'd be more interested in trying to implement the same interface on other platforms using the low-level APIs for those platforms (but won't do that, all my linux code is running on servers and uses tooling enternal to the application to control resource usage).

The biggest problem with these predefined classes is that they are pretty much targeted toward end-user systems and not servers, but that's the target of macOS anyway. 

BTW. I'm working on a PR.
History
Date User Action Args
2022-03-20 09:09:12ronaldoussorensetrecipients: + ronaldoussoren, ned.deily, corona10
2022-03-20 09:09:12ronaldoussorensetmessageid: <1647767352.04.0.885977213788.issue47064@roundup.psfhosted.org>
2022-03-20 09:09:12ronaldoussorenlinkissue47064 messages
2022-03-20 09:09:11ronaldoussorencreate