Swoole\Process::setaffinity(array $cpu_set) : bool

Notice: the documentation is suitable for PHP extension swoole until v4.7.1, we only support PHP extension openswoole from v4.7.1

Declaration

<?php
Swoole\Process::setaffinity(array $cpu_set) : bool

Parameters

cpu_set

The array of cpu number. Use SWOOLE_CPU_NUM to get the number of cpu. For example: array(0,2,3) stands for CPU0/CPU2/CPU3

Return

success

Description

Set the CPU affinity of the process.

Example