<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.exec.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.proc-nice.php',
    1 => 'proc_nice',
    2 => '現在のプロセスの優先度を変更する',
  ),
  'up' => 
  array (
    0 => 'ref.exec.php',
    1 => 'プログラム実行関数',
  ),
  'prev' => 
  array (
    0 => 'function.proc-get-status.php',
    1 => 'proc_get_status',
  ),
  'next' => 
  array (
    0 => 'function.proc-open.php',
    1 => 'proc_open',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/exec/functions/proc-nice.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.proc-nice" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">proc_nice</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">proc_nice</span> &mdash; <span class="dc-title">現在のプロセスの優先度を変更する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.proc-nice-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>proc_nice</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$priority</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>proc_nice()</strong></span> は、現在のプロセスの優先度を
   <code class="parameter">priority</code> で指定された値に変更します。
   <code class="parameter">priority</code> が正数の場合、
   現在のプロセスの優先度をより低くし、<code class="parameter">priority</code>
   が負数の場合は優先度が上がります。
  </p>
  <p class="para">
   <span class="function"><strong>proc_nice()</strong></span> は、<span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span>
   やそれに関連する関数とは関係ありません。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.proc-nice-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">priority</code></dt>
     <dd>
      <p class="para">
       新しい優先度の値。この値はプラットフォームによっては異なるかもしれません。
      </p>
      <p class="para">
       Unix 上では、<code class="literal">-20</code> のように低い値が高い優先度である一方で、
       正の値は低い優先度として扱われます。
      </p>
      <p class="para">
       Windows では、
       <code class="parameter">priority</code> パラメータは次のような意味があります:
      </p>
      <table class="doctable informaltable">
       
        <thead>
         <tr>
          <th>優先度クラス</th>
          <th>取りうる値</th>
         </tr>

        </thead>

        <tbody class="tbody">
         <tr>
          <td style="vertical-align: top;">優先度高</td>
          <td style="vertical-align: top;">
           <code class="parameter">priority</code> <code class="literal">&lt; -9</code>
          </td>
         </tr>

         <tr>
          <td style="vertical-align: top;">通常より高い優先度</td>
          <td style="vertical-align: top;">
           <code class="parameter">priority</code> <code class="literal">&lt; -4</code>
          </td>
         </tr>

         <tr>
          <td style="vertical-align: top;">通常の優先度</td>
          <td style="vertical-align: top;">
           <code class="parameter">priority</code> <code class="literal">&lt; 5</code> &amp; 
           <code class="parameter">priority</code> <code class="literal">&gt; -5</code>
          </td>
         </tr>

         <tr>
          <td style="vertical-align: top;">通常より低い優先度</td>
          <td style="vertical-align: top;">
           <code class="parameter">priority</code> <code class="literal">&gt; 5</code>
          </td>
         </tr>

         <tr>
          <td style="vertical-align: top;">アイドルな優先度</td>
          <td style="vertical-align: top;">
           <code class="parameter">priority</code> <code class="literal">&gt; 9</code>
          </td>
         </tr>

        </tbody>
       
      </table>

     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.proc-nice-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   成功した場合に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を、失敗した場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
   ユーザーが優先度を変更する権限を持っていないなど、
   エラーが発生した場合は <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>
   レベルのエラーも発行されます。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.proc-nice-changelog">
  <h3 class="title">変更履歴</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>バージョン</th>
       <th>説明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>7.2.0</td>
       <td>
        この関数は、Windows で利用できるようになりました。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.proc-nice-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 <span class="function"><strong>proc_nice()</strong></span> 関数を使い、プロセスの優先度を高に設定する</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Highest priority<br /></span><span style="color: #0000BB">proc_nice</span><span style="color: #007700">(-</span><span style="color: #0000BB">20</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>

 </div>


 <div class="refsect1 notes" id="refsect1-function.proc-nice-notes">
  <h3 class="title">注意</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <strong>可用性</strong><br />
   <p class="para">
    <span class="function"><strong>proc_nice()</strong></span> は、使用しているシステムが &#039;nice&#039;
    の機能を持っている場合のみ利用可能です。
    &#039;nice&#039; は次のシステムに準拠しています:
    SVr4, SVID EXT, AT&amp;T, X/OPEN, BSD 4.3 。
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <strong>Windows のみ</strong><br />
   <p class="para">
    <span class="function"><strong>proc_nice()</strong></span> 関数は、
    PHP がたとえスレッドセーフを有効にしてコンパイルされていたとしても、
    現在の <em>プロセス</em> の優先度を変更します。
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.proc-nice-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.pcntl-setpriority.php" class="function" rel="rdfs-seeAlso">pcntl_setpriority()</a> - プロセスの優先度を変更する</span></li>
  </ul>
 </div>

</div><?php manual_footer($setup); ?>