reference/exec/functions/proc-nice.xml
4ecb2c1b4ba1b51c5e9678a7908e001df9bc92f5
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xml:id='function.proc-nice' xmlns="http://docbook.org/ns/docbook">
3
+
<refentry xml:id="function.proc-nice" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>proc_nice</refname>
6
6
<refpurpose>Change the priority of the current process</refpurpose>
...
...
@@ -10,13 +10,13 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>bool</type><methodname>proc_nice</methodname>
13
-
<methodparam><type>int</type><parameter>increment</parameter></methodparam>
13
+
<methodparam><type>int</type><parameter>priority</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
<function>proc_nice</function> changes the priority of the current
17
-
process by the amount specified in <parameter>increment</parameter>. A
18
-
positive <parameter>increment</parameter> will lower the priority of the
19
-
current process, whereas a negative <parameter>increment</parameter>
17
+
process by the amount specified in <parameter>priority</parameter>. A
18
+
positive <parameter>priority</parameter> will lower the priority of the
19
+
current process, whereas a negative <parameter>priority</parameter>
20
20
will raise the priority.
21
21
</para>
22
22
<para>
...
...
@@ -30,11 +30,62 @@
30
30
<para>
31
31
<variablelist>
32
32
<varlistentry>
33
-
<term><parameter>increment</parameter></term>
33
+
<term><parameter>priority</parameter></term>
34
34
<listitem>
35
35
<para>
36
-
The increment value of the priority change.
36
+
The new priority value, the value of this may differ on platforms.
37
37
</para>
38
+
<para>
39
+
On Unix, a low value, such as <literal>-20</literal> means high priority
40
+
whereas positive values have a lower priority.
41
+
</para>
42
+
<para>
43
+
For Windows the <parameter>priority</parameter> parameter has the
44
+
following meaning:
45
+
</para>
46
+
<informaltable>
47
+
<tgroup cols="3">
48
+
<thead>
49
+
<row>
50
+
<entry valign="top">Priority class</entry>
51
+
<entry valign="top">Possible values</entry>
52
+
</row>
53
+
</thead>
54
+
<tbody>
55
+
<row>
56
+
<entry valign="top">High priority</entry>
57
+
<entry valign="top">
58
+
<parameter>priority</parameter> <literal>&lt; -9</literal>
59
+
</entry>
60
+
</row>
61
+
<row>
62
+
<entry valign="top">Above normal priority</entry>
63
+
<entry valign="top">
64
+
<parameter>priority</parameter> <literal>&lt; -4</literal>
65
+
</entry>
66
+
</row>
67
+
<row>
68
+
<entry valign="top">Normal priority</entry>
69
+
<entry valign="top">
70
+
<parameter>priority</parameter> <literal>&lt; 5</literal> &amp;
71
+
<parameter>priority</parameter> <literal>&gt; -5</literal>
72
+
</entry>
73
+
</row>
74
+
<row>
75
+
<entry valign="top">Below normal priority</entry>
76
+
<entry valign="top">
77
+
<parameter>priority</parameter> <literal>&gt; 5</literal>
78
+
</entry>
79
+
</row>
80
+
<row>
81
+
<entry valign="top">Idle priority</entry>
82
+
<entry valign="top">
83
+
<parameter>priority</parameter> <literal>&gt; 9</literal>
84
+
</entry>
85
+
</row>
86
+
</tbody>
87
+
</tgroup>
88
+
</informaltable>
38
89
</listitem>
39
90
</varlistentry>
40
91
</variablelist>
...
...
@@ -50,6 +101,48 @@
50
101
</para>
51
102
</refsect1>
52
103

104
+
<refsect1 role="changelog">
105
+
&reftitle.changelog;
106
+
<para>
107
+
<informaltable>
108
+
<tgroup cols="2">
109
+
<thead>
110
+
<row>
111
+
<entry>&Version;</entry>
112
+
<entry>&Description;</entry>
113
+
</row>
114
+
</thead>
115
+
<tbody>
116
+
<row>
117
+
<entry>7.2.0</entry>
118
+
<entry>
119
+
This function is now available on Windows.
120
+
</entry>
121
+
</row>
122
+
</tbody>
123
+
</tgroup>
124
+
</informaltable>
125
+
</para>
126
+
</refsect1>
127
+

128
+
<refsect1 role="examples">
129
+
&reftitle.examples;
130
+
<para>
131
+
<example>
132
+
<title>Using <function>proc_nice</function> to set the process priority to high</title>
133
+
<programlisting role="php">
134
+
<![CDATA[
135
+
<?php
136
+
// Highest priority
137
+
proc_nice(-20);
138
+
?>
139
+
]]>
140
+
</programlisting>
141
+
</example>
142
+
</para>
143
+

144
+
</refsect1>
145
+

53
146
<refsect1 role="notes">
54
147
&reftitle.notes;
55
148
<note>
...
...
@@ -57,13 +150,25 @@
57
150
<para>
58
151
<function>proc_nice</function> will only exist if your system has 'nice'
59
152
capabilities. 'nice' conforms to: SVr4, SVID EXT, AT&amp;T, X/OPEN, BSD
60
-
4.3. This means that <function>proc_nice</function> is not available
61
-
on Windows.
153
+
4.3.
154
+
</para>
155
+
</note>
156
+
<note>
157
+
<title>Windows only</title>
158
+
<para>
159
+
<function>proc_nice</function> will change the current <emphasis>process</emphasis>
160
+
priority, even if PHP was compiled using thread safety.
62
161
</para>
63
162
</note>
64
163
</refsect1>
65
-
</refentry>
66
164

165
+
<refsect1 role="seealso">
166
+
&reftitle.seealso;
167
+
<simplelist>
168
+
<member><function>pcntl_setpriority</function></member>
169
+
</simplelist>
170
+
</refsect1>
171
+
</refentry>
67
172
<!-- Keep this comment at the end of the file
68
173
Local variables:
69
174
mode: sgml
70
175