note 35382 added to function.proc-close
| From: | sergey1369 at narod dot ru | Date: | Fri, 29 Aug 2003 08:16:32 +0000 |
| Subject: | note 35382 added to function.proc-close | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-55282@lists.php.net to get a copy of this message | ||
Under PHP/4.3.3RC2, in case of two processes
these function may hangs. Work around is not use
proc_close, or put it after all fcloses done.
For example, this code hangs.
$ph1 = proc_open("cat",
array(0=>array("pipe","r"),1=>array("pipe","w")),
$pipes1);
$ph2 = proc_open("cat",
array(0=>array("pipe","r"),1=>array("pipe","w")),
$pipes2);
fclose($pipes1[0]); fclose($pipes1[1]); proc_close($ph1);
fclose($pipes2[0]); fclose($pipes2[1]); proc_close($ph2);
This code worked for me:
$ph1 = proc_open("cat",
array(0=>array("pipe","r"),1=>array("pipe","w")),
$pipes1);
$ph2 = proc_open("cat",
array(0=>array("pipe","r"),1=>array("pipe","w")),
$pipes2);
fclose($pipes1[0]); fclose($pipes1[1]);
fclose($pipes2[0]); fclose($pipes2[1]);
proc_close($ph1); proc_close($ph2);
----
Manual Page -- http://www.php.net/manual/en/function.proc-close.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35382
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35382&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35382&report=yes