Bug #2077: pclose calling waitid() for forked processes
| From: | markm at dct dot com | Date: | Mon, 16 Aug 1999 21:21:57 +0000 |
| Subject: | Bug #2077: pclose calling waitid() for forked processes | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-9898@lists.php.net to get a copy of this message | ||
From: markm@dct.com
Operating system: Solaris 2.6
PHP version: 3.0.11
PHP Bug Type: Performance problem
Bug description: pclose calling waitid() for forked processes
I have noticed by browsing through truss files that when pclose is called after a popen, waitid is
called. I can understand why, since pclose returns the status of the process exec'ed off by
popen. This does become a burden, however when the exec'ed process takes some time to run.
For example, in many thinks I have been doing, I have been using popen to open a pipe to sendmail,
and send out mail. When pclose is then called, it takes anywhere from 5 to 6 seconds to fufill that
function call. This takes place for EACH pclose call, which can significantly slow down the loading
of a web page.
I'd like to maybe suggest a second argument to pclose, which would be a boolean, as to whether
or not the programmer wants the exit status of the exec'ed process, or pclose itself. The
default value could have pclose work the way it currently does. This would allow those of us who
run into this problem an easy speed workaround.