php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #20189 PCNTL docs need updating to reflect 4.3.0 behavior
Submitted: 2002-10-31 07:09 UTC Modified: 2004-02-25 02:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: luca dot mariano at email dot it Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.0 OS: all
Private report: No CVE-ID: None
 [2002-10-31 07:09 UTC] luca dot mariano at email dot 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.




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-31 08:17 UTC] edink@php.net
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.
 [2003-01-23 17:07 UTC] philip@php.net
Granted this was assigned to Jason, I added some documenation on this fact which closes this bug but I'm rewriting the summary as all the pcntl docs need updating.

The following changes took place.
http://cvs.php.net/cvs.php/phpdoc/en/reference/pcntl/reference.xml
http://cvs.php.net/cvs.php/phpdoc/en/reference/pcntl/functions/pcntl-signal.xml

You will see similarities between the changes and Jasons email :)  Note I added "declare(ticks = 1)" in a couple examples.  I believe Jason will eventually rewrite these but at least they should work now.
 [2004-02-25 02:00 UTC] irchtml@php.net
Status -> Closed, per philip@php.net "...which closes this bug..."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 22:01:26 2024 UTC