Bug #71437 [Com]: pcntl_signal(SIGCHLD, SIG_IGN); dont work property
| From: | dave at mudsite dot com | Date: | Fri, 15 Jul 2016 23:15:02 +0000 |
| Subject: | Bug #71437 [Com]: pcntl_signal(SIGCHLD, SIG_IGN); dont work property | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202360@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71437&edit=1
ID: 71437
Comment by: dave at mudsite dot com
Reported by: bupycnet at gmail dot com
Summary: pcntl_signal(SIGCHLD, SIG_IGN); dont work property
Status: Open
Type: Bug
Package: PCNTL related
Operating System: ArchLinux
PHP Version: 7.0.3RC1
Block user comment: N
Private report: N
New Comment:
I'm not quite sure which sleep you're talking about that needs to exist, however, your
test script doesn't seem to have any problems to me. If you're using the sleep(60) to
ensure that all children finish, you should be using pcntl_wait(), which will block until all
children finish.
Previous Comments:
------------------------------------------------------------------------
[2016-01-23 23:15:28] bupycnet at gmail dot com
Description:
------------
1. If i use it - sleep function dont work.
2. It if use it in class - its not work.
Test script:
---------------
declare(ticks = 1);
pcntl_signal(SIGCHLD, SIG_IGN);
for($i=0;$i<300;$i++){
$pid = pcntl_fork();
if ($pid == -1) {
die('could not fork');
} else if ($pid) {
usleep(2500);
} else {
echo 'Child'.$i."\r\n";
sleep(mt_rand(1,3));
exit;
}
}
echo 'Test123';
sleep(60);
echo 'Test456';
Expected result:
----------------
This script work withouts sleep
Actual result:
--------------
Sleep need work.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71437&edit=1