note 43715 added to function.pcntl-fork
| From: | ej | Date: | Thu, 01 Jul 2004 02:56:37 +0000 |
| Subject: | note 43715 added to function.pcntl-fork | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-72224@lists.php.net to get a copy of this message | ||
If you understand what a UNiX fork() command actually does, then the behaviour astrolox describes
below is precisely what one would expect. A fork() command creates an identical process (save for
the PID) and that includes the TEXT segment, DATA segment, stack, heap, file descriptors, etc. If
you don't want the child to have what's in the buffer, just throw it out (in the child -
the parent doesn't need to do anything differently).
As for his new server that doesn't display the same behaviour, I'm not sure what to say.
It would be a mistake for PHP to throw away that buffer for you behind the scenes because someone
may well want a child that has access to that buffer. If fork() is properly implemented the *ONLY*
thing that is different in the child is that it has it's own PID.
----
Manual Page -- http://www.php.net/manual/en/function.pcntl-fork.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43715
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43715&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43715&report=yes
Search -- http://master.php.net/manage/user-notes.php