Greetings.
First of all I must apologyse for my english.
I have used multi processing before in C but know I have a project that it would be usefull to use it in php.
Here comes the problema I installed php support for pcntl_fork and when running a simple test program It does not work correctly.
the problem is only one of the print appears on screen.
When I reload the page sometimes I get In the parent and sometimes in the child.
I would be most thankfull I someone could help me
Regards
First of all I must apologyse for my english.
I have used multi processing before in C but know I have a project that it would be usefull to use it in php.
Here comes the problema I installed php support for pcntl_fork and when running a simple test program It does not work correctly.
Code:
$pid = pcntl_fork(); if ($pid != -1) { if ($pid) { print "In the parent: child PID is $pid\n"; } else { print "In the child\n"; } } else { echo "Fork failed!\n"; }
the problem is only one of the print appears on screen.
When I reload the page sometimes I get In the parent and sometimes in the child.
I would be most thankfull I someone could help me
Regards
Comment