#include <sys/qos.h>
sys/qos.h
@typedef qos_class_t
@abstract
An abstract thread quality of service (QOS) classification.
@discussion
Thread quality of service (QOS) classes are ordered abstract representations
of the nature of work that is expected to be performed by a pthread, dispatch
queue, or NSOperation. Each class specifies a maximum thread scheduling
priority for that band (which may be used in combination with a relative
priority offset within the band), as well as quality of service
characteristics for timer latency, CPU throughput, I/O throughput, network
socket traffic management behavior and more.
A best effort is made to allocate available system resources to every QOS
class. Quality of service degredation only occurs during system resource
contention, proportionally to the QOS class. That said, QOS classes
representing user-initiated work attempt to achieve peak throughput while
QOS classes for other work attempt to achieve peak energy and thermal
efficiency, even in the absence of contention. Finally, the use of QOS
classes does not allow threads to supersede any limits that may be applied
to the overall process.
enum(anonymous)
| QOS_CLASS_USER_INTERACTIVE | 33 | |
| QOS_CLASS_USER_INITIATED | 25 | |
| QOS_CLASS_DEFAULT | 21 | |
| QOS_CLASS_UTILITY | 17 | |
| QOS_CLASS_BACKGROUND | 9 | |
| QOS_CLASS_UNSPECIFIED | 0 |
typedefqos_class_t
typedef unsigned int qos_class_t;
macroQOS_MIN_RELATIVE_PRIORITY
@constant QOS_MIN_RELATIVE_PRIORITY
@abstract The minimum relative priority that may be specified within a
QOS class. These priorities are relative only within a given QOS class
and meaningful only for the current process.
#define QOS_MIN_RELATIVE_PRIORITY (-15)
functionqos_class_self
__API_AVAILABLE(macos(10.10), ios(8.0)) qos_class_t qos_class_self(void)
@function qos_class_self
@abstract Returns the requested QOS class of the current thread.
@return One of the QOS class values in qos_class_t.
functionqos_class_main
__API_AVAILABLE(macos(10.10), ios(8.0)) qos_class_t qos_class_main(void)
@function qos_class_main
@abstract Returns the initial requested QOS class of the main thread.
@discussion The QOS class that the main thread of a process is created with depends on
the type of process (e.g. application or daemon) and on how it has been
launched.
This function returns that initial requested QOS class value chosen by the
system to enable propagation of that classification to matching work not
executing on the main thread.
@return One of the QOS class values in qos_class_t.