Ronald Oussoren <ronaldousso...@mac.com> added the comment:

> 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.

----------

_______________________________________
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