mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
99 lines
3.4 KiB
HTML
99 lines
3.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title>修改任意进程的优先级</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.pcntl-setpriority" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">pcntl_setpriority</h1>
|
||
<p class="verinfo">(PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">pcntl_setpriority</span> — <span class="dc-title">修改任意进程的优先级</span></p>
|
||
|
||
</div>
|
||
|
||
<div class="refsect1 description" id="refsect1-function.pcntl-setpriority-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>pcntl_setpriority</strong></span>
|
||
( <span class="methodparam"><span class="type">int</span> <code class="parameter">$priority</code></span>
|
||
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$pid</code><span class="initializer"> = getmypid()</span></span>
|
||
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$process_identifier</code><span class="initializer"> = PRIO_PROCESS</span></span>
|
||
]] ) : <span class="type">bool</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
<span class="function"><strong>pcntl_setpriority()</strong></span> 设置进程号为
|
||
<code class="parameter">pid</code>的进程的优先级。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.pcntl-setpriority-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">priority</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
<code class="parameter">priority</code> 通常时-20至20这个范围内的值。默认优先级是0,值越小代表
|
||
优先级越高。由于不同的系统类型以及内核版本下优先级可能不同,因此请参考您系统的setpriority(2)
|
||
手册以获取详细的规范。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">pid</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
如果没有指定,默认是当前进程的进程号。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">process_identifier</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
<strong><code>PRIO_PGRP</code></strong>(译注:获取进程组优先级), <strong><code>PRIO_USER</code></strong>
|
||
(译注:获取用户进程优先级)或 <strong><code>PRIO_PROCESS(译注:默认值;获取进程优先级)</code></strong>三者之一。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.pcntl-setpriority-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
成功时返回 <strong><code>TRUE</code></strong>, 或者在失败时返回 <strong><code>FALSE</code></strong>。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 seealso" id="refsect1-function.pcntl-setpriority-seealso">
|
||
<h3 class="title">参见</h3>
|
||
<p class="para">
|
||
<ul class="simplelist">
|
||
<li class="member"><span class="function"><a href="pcntl_getpriority.html" class="function" rel="rdfs-seeAlso">pcntl_getpriority()</a> - 获取任意进程的优先级</span></li>
|
||
</ul>
|
||
</p>
|
||
</div>
|
||
|
||
|
||
</div></div></div></body></html> |