男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站

pcntl_rfork

(PHP 8 >= 8.1.0)

pcntl_rforkManipulates process resources

說(shuō)明

pcntl_rfork(int $flags, int $signal = 0): int

Manipulates process resources.

參數

flags

The flags parameter determines which resources of the invoking process (parent) are shared by the new process (child) or initialized to their default values.

flags is the logical OR of some subset of:

  • RFPROC: If set a new process is created; otherwise changes affect the current process.
  • RFNOWAIT: If set, the child process will be dissociated from the parent. Upon exit the child will not leave a status for the parent to collect.
  • RFFDG: If set, the invoker's file descriptor table is copied; otherwise the two processes share a single table.
  • RFCFDG: If set, the new process starts with a clean file descriptor table. Is mutually exclusive with RFFDG.
  • RFLINUXTHPN: If set, the kernel will return SIGUSR1 instead of SIGCHILD upon thread exit for the child. This is intended to do Linux clone exit parent notification.

signal

The signal number.

返回值

On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a -1 will be returned in the parent's context, no child process will be created, and a PHP error is raised.

范例

示例 #1 pcntl_rfork() example

<?php

$pid 
pcntl_rfork(RFNOWAIT|RFTSIGZMBSIGUSR1);
if (
$pid 0) {
  
// This is the parent process.
  
var_dump($pid);
} else {
  
// This is the child process.
  
var_dump($pid);
  
sleep(2); // as the child does not wait, so we see its "pid"
}
?>

以上例程的輸出類(lèi)似于:

int(77093)
int(0)

參見(jiàn)

  • pcntl_fork() - 在當前進(jìn)程當前位置產(chǎn)生分支(子進(jìn)程)。譯注:fork是創(chuàng )建了一個(gè)子進(jìn)程,父進(jìn)程和子進(jìn)程 都從fork的位置開(kāi)始向下繼續執行,不同的是父進(jìn)程執行過(guò)程中,得到的fork返回值為子進(jìn)程 號,而子進(jìn)程得到的是0。
  • pcntl_waitpid() - 等待或返回fork的子進(jìn)程狀態(tài)
  • pcntl_signal() - 安裝一個(gè)信號處理器
  • cli_set_process_title() - Sets the process title

男女疯狂一边摸一边做羞羞视频|啊好深好硬快点用力别停动态图|亚洲一区无码中文字幕|特级无码毛片免费视频播放▽|久久狠狠躁免费观看|国内精品久久久久久网站