|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- $Revision$ --> |
| 3 | +<refentry xml:id="function.pcntl-setqos-class" xmlns="http://docbook.org/ns/docbook"> |
| 4 | + <refnamediv> |
| 5 | + <refname>pcntl_setqos_class</refname> |
| 6 | + <refpurpose>Set the QoS class of the current thread</refpurpose> |
| 7 | + </refnamediv> |
| 8 | + |
| 9 | + <refsect1 role="description"> |
| 10 | + &reftitle.description; |
| 11 | + <methodsynopsis> |
| 12 | + <type>void</type><methodname>pcntl_setqos_class</methodname> |
| 13 | + <methodparam choice="opt"><type>Pcntl\QosClass</type><parameter>qos_class</parameter><initializer><constant>Pcntl\QosClass::Default</constant></initializer></methodparam> |
| 14 | + </methodsynopsis> |
| 15 | + <simpara> |
| 16 | + Set the QoS class. |
| 17 | + </simpara> |
| 18 | + </refsect1> |
| 19 | + |
| 20 | + <refsect1 role="parameters"> |
| 21 | + &reftitle.parameters; |
| 22 | + <variablelist> |
| 23 | + <varlistentry> |
| 24 | + <term><parameter>qos_class</parameter></term> |
| 25 | + <listitem> |
| 26 | + <para> |
| 27 | + The Quality of Service class to assign to the current thread. The |
| 28 | + operating system uses this as a hint to schedule CPU time, I/O priority, |
| 29 | + and energy usage, with higher classes preempting lower ones. See |
| 30 | + <enumname>Pcntl\QosClass</enumname> for the available cases. |
| 31 | + </para> |
| 32 | + <para> |
| 33 | + <variablelist> |
| 34 | + <varlistentry> |
| 35 | + <term><constant>Pcntl\QosClass::UserInteractive</constant></term> |
| 36 | + <listitem> |
| 37 | + <simpara> |
| 38 | + Highest priority. Intended for work that directly drives a user |
| 39 | + interface and must complete virtually instantly to avoid perceived |
| 40 | + delay, such as event handling or drawing. |
| 41 | + </simpara> |
| 42 | + </listitem> |
| 43 | + </varlistentry> |
| 44 | + <varlistentry> |
| 45 | + <term><constant>Pcntl\QosClass::UserInitiated</constant></term> |
| 46 | + <listitem> |
| 47 | + <simpara> |
| 48 | + High priority, just below <constant>UserInteractive</constant>. |
| 49 | + Intended for work the user has explicitly initiated and is actively |
| 50 | + waiting on, expected to complete within a few seconds. |
| 51 | + </simpara> |
| 52 | + </listitem> |
| 53 | + </varlistentry> |
| 54 | + <varlistentry> |
| 55 | + <term><constant>Pcntl\QosClass::Default</constant></term> |
| 56 | + <listitem> |
| 57 | + <simpara> |
| 58 | + Standard priority, used when no more specific class applies. Runs |
| 59 | + after higher-priority work but ahead of <constant>Utility</constant> |
| 60 | + and <constant>Background</constant>. |
| 61 | + </simpara> |
| 62 | + </listitem> |
| 63 | + </varlistentry> |
| 64 | + <varlistentry> |
| 65 | + <term><constant>Pcntl\QosClass::Utility</constant></term> |
| 66 | + <listitem> |
| 67 | + <simpara> |
| 68 | + Lower priority, intended for long-running work the user is aware of |
| 69 | + but not actively waiting on, such as downloads, imports, or bulk |
| 70 | + computation. Scheduled in an energy-efficient manner. |
| 71 | + </simpara> |
| 72 | + </listitem> |
| 73 | + </varlistentry> |
| 74 | + <varlistentry> |
| 75 | + <term><constant>Pcntl\QosClass::Background</constant></term> |
| 76 | + <listitem> |
| 77 | + <simpara> |
| 78 | + Lowest priority, intended for work the user is not aware of, such as |
| 79 | + prefetching, indexing, or maintenance. Heavily optimized for energy |
| 80 | + efficiency and may be deferred when the system is under load. |
| 81 | + </simpara> |
| 82 | + </listitem> |
| 83 | + </varlistentry> |
| 84 | + </variablelist> |
| 85 | + </para> |
| 86 | + </listitem> |
| 87 | + </varlistentry> |
| 88 | + </variablelist> |
| 89 | + <note> |
| 90 | + <simpara>This function is only available on Apple platforms.</simpara> |
| 91 | + </note> |
| 92 | + </refsect1> |
| 93 | + |
| 94 | + <refsect1 role="returnvalues"> |
| 95 | + &reftitle.returnvalues; |
| 96 | + <simpara> |
| 97 | + &return.void; |
| 98 | + </simpara> |
| 99 | + </refsect1> |
| 100 | + |
| 101 | + <refsect1 role="errors"> |
| 102 | + &reftitle.errors; |
| 103 | + <simpara> |
| 104 | + Throws an <classname>Error</classname> if the underlying call to |
| 105 | + <literal>pthread_set_qos_class_self_np()</literal> fails. |
| 106 | + </simpara> |
| 107 | + </refsect1> |
| 108 | + |
| 109 | + <refsect1 role="seealso"> |
| 110 | + &reftitle.seealso; |
| 111 | + <simplelist> |
| 112 | + <member><function>pcntl_getqos_class</function></member> |
| 113 | + <member><enumname>Pcntl\QosClass</enumname></member> |
| 114 | + </simplelist> |
| 115 | + </refsect1> |
| 116 | + |
| 117 | +</refentry> |
| 118 | +<!-- Keep this comment at the end of the file |
| 119 | +Local variables: |
| 120 | +mode: sgml |
| 121 | +sgml-omittag:t |
| 122 | +sgml-shorttag:t |
| 123 | +sgml-minimize-attributes:nil |
| 124 | +sgml-always-quote-attributes:t |
| 125 | +sgml-indent-step:1 |
| 126 | +sgml-indent-data:t |
| 127 | +indent-tabs-mode:nil |
| 128 | +sgml-parent-document:nil |
| 129 | +sgml-default-dtd-file:"~/.phpdoc/manual.ced" |
| 130 | +sgml-exposed-tags:nil |
| 131 | +sgml-local-catalogs:nil |
| 132 | +sgml-local-ecat-files:nil |
| 133 | +End: |
| 134 | +vim600: syn=xml fen fdm=syntax fdl=2 si |
| 135 | +vim: et tw=78 syn=sgml |
| 136 | +vi: ts=1 sw=1 |
| 137 | +--> |
0 commit comments