pcntl_setcpuaffinity
Set the cpu affinity of a process
説明
bool pcntl_setcpuaffinity(intnull $pid
= null
, array $hmask
= ?)
Sets the cpu affinity for the pid
with the cpu affinity mask given by
hmask
.
パラメータ
-
pid
-
If
null
, the current process ID is used.
-
hmask
-
The cpu affinity mask comprised of one or more cpu id for binding the process to.
戻り値
成功した場合に true
を、失敗した場合に false
を返します。
警告この関数は論理値
false
を返す可能性がありますが、false
として評価される値を返す可能性もあります。
詳細については 論理値の
セクションを参照してください。この関数の返り値を調べるには
===演算子 を
使用してください。
エラー / 例外
A TypeError is thrown if one
of the cpu id from the hmask
is invalid.
A ValueError is thrown if
pid
is an invalid process id
or the cpu mask had failed to be created.