Re: parallell execution
| From: | Flavien Lebarbé | Date: | Wed, 30 Aug 2000 23:44:48 +0000 |
| Subject: | Re: parallell execution | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-31359@lists.php.net to get a copy of this message | ||
Andi wrote about implementing fork() in PHP :
> It is extremely hard to implement it and it would slow things down
> considerably because we would need to use lots and lots of mutexes in
> hundreds of places.
What about the following behaviour :
===
<?php
echo 'ONE';
$result=fork();
if ($result<0) {
echo "Fork failed!";
exit;
}
if ($result) {
echo "I'm MASTER!";
}
else {
echo "This goes nowhere";
}
?>
===
When fork'ing, it just behaves like C : create two separate entities,
so
forking the whole PHP process (interpreter, variables... everything
just
like in C). The 'son' process cannot send any output, it is just able
to send data to 'father' using shm_* functions which are already
implemented...
Where are mutexes necessary, then ?
Flavien Lebarbé, curious. :)