Added support to set base priority of the service. This way, PHP won't hog the machine when running as a service.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@305252 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Richard Quadling 2010-11-10 17:02:54 +00:00
parent bae6b5c7e0
commit e5a0171213
2 changed files with 88 additions and 0 deletions

View file

@ -543,6 +543,79 @@
</tgroup>
</table>
<table xml:id="win32service.constants.basepriorities">
<title>Win32 Base Priority Classes</title>
<tgroup cols="3">
<thead>
<row>
<entry>Constant</entry>
<entry>Value</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><constant>WIN32_ABOVE_NORMAL_PRIORITY_CLASS</constant></entry>
<entry>0x00008000</entry>
<entry>
Process that has priority above WIN32_NORMAL_PRIORITY_CLASS but below
WIN32_HIGH_PRIORITY_CLASS.
</entry>
</row>
<row>
<entry><constant>WIN32_BELOW_NORMAL_PRIORITY_CLASS</constant></entry>
<entry>0x00004000</entry>
<entry>
Process that has priority above WIN32_IDLE_PRIORITY_CLASS but below
WIN32_NORMAL_PRIORITY_CLASS.
</entry>
</row>
<row>
<entry><constant>WIN32_HIGH_PRIORITY_CLASS</constant></entry>
<entry>0x00000080</entry>
<entry>
Process that performs time-critical tasks that must be executed
immediately. The threads of the process preempt the threads of normal or
idle priority class processes. An example is the Task List, which must
respond quickly when called by the user, regardless of the load on the
operating system. Use extreme care when using the high-priority class,
because a high-priority class application can use nearly all available
CPU time.
</entry>
</row>
<row>
<entry><constant>WIN32_IDLE_PRIORITY_CLASS</constant></entry>
<entry>0x00000040</entry>
<entry>
Process whose threads run only when the system is idle. The threads of the
process are preempted by the threads of any process running in a higher
priority class. An example is a screen saver. The idle-priority class is
inherited by child processes.
</entry>
</row>
<row>
<entry><constant>WIN32_NORMAL_PRIORITY_CLASS</constant></entry>
<entry>0x00000020</entry>
<entry>
Process with no special scheduling needs.
</entry>
</row>
<row>
<entry><constant>WIN32_REALTIME_PRIORITY_CLASS</constant></entry>
<entry>0x00000100</entry>
<entry>
Process that has the highest possible priority. The threads of the
process preempt the threads of all other processes, including operating
system processes performing important tasks. For example, a real-time
process that executes for more than a very brief interval can cause disk
caches not to flush or cause the mouse to be unresponsive.
</entry>
</row>
</tbody>
</tgroup>
</table>
</appendix>
<!-- Keep this comment at the end of the file

View file

@ -150,6 +150,20 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>base_priority</parameter></term>
<listitem>
<para>
To reduce the impact on processor utilisation, it may be necessary
to set a base priority lower than normal.
</para>
<para>
The <parameter>base_priority</parameter> can be set to one of the
constants define in
<link linkend="win32service.constants.basepriorities">Win32 Base Priority Classes</link>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
@ -204,6 +218,7 @@ debug_zval_dump($x);
<para>
<simplelist>
<member><function>win32_delete_service</function></member>
<member><link linkend="win32service.constants.basepriorities">Win32 Base Priority Classes</link></member>
<member><link linkend="win32service.constants.errors">Win32 Error Codes</link></member>
</simplelist>
</para>