#20189 [Opn]: pcnt_signal does not work
| From: | edink@php.net | Date: | Thu, 31 Oct 2002 14:17:46 +0000 |
| Subject: | #20189 [Opn]: pcnt_signal does not work | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969349366@lists.php.net to get a copy of this message | ||
ID: 20189
Updated by: edink@php.net
Reported By: luca.mariano@email.it
Status: Open
-Bug Type: PCRE related
+Bug Type: Documentation problem
Operating System: Linux RedHat 7.1
PHP Version: 4.3.0-pre2
-Assigned To:
+Assigned To: jason
New Comment:
There has been (udocumented) change to pcntl extension. Take a look at
http://www.zend.com/lists/php-dev/200208/msg00937.html
Changing to documentation problem and assigning to Jason.
Previous Comments:
------------------------------------------------------------------------
[2002-10-31 07:09:01] luca.mariano@email.it
I'm currently working with PHP-CLI in order to write a comprensive
multithread server framework, using the following PHP modules:
-PCNTL (for process forking)
-SOCKETS (for managing of sockets...)
-SYSVSEM (semaphores to syncronyze threads)
-SYSVSHM (for sharing data between threads)
-XMLRPC (the best object broking for me)
I noticed a strange behaviour of my apps when i use the PHP4.3
executable; the following test script does not work under 4.3, while it
works under 4.2.
<?php
define (PULL_TIME,"1"); //event check frequency (secs)
function usr1_handle($signal){
if ($signal==SIGUSR1)
print time() . "-Received signal!\n";
}
print "Server starting at " . time() . " ...\n";
$pid=pcntl_fork();
if ($pid==0) {
// this is the child
pcntl_signal(SIGUSR1, "usr1_handle");
sleep(5);
$i = 0;
while(true) {sleep(1);}
} else {
//this is the parent
sleep(5);
while(true) {
posix_kill($pid,SIGUSR1);
sleep(PULL_TIME);
}
}
?>
No backtrace avaible, PHP does not crash, simply do nothing.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20189&edit=1