Re: [PHP] Re: process creation
- From: tsinc60@xxxxxxxxxxxxxxxx (Tom Sinclair)
- Date: Sun, 25 Jan 2009 07:02:01 -0500
Per Jessen wrote:
Török Alpár wrote:
as i said it's hate here, and i might be wrong but consider the
following :
for($icount=0;$icount<11;$icount++)
{
$iPid = pcntl_fork();
$iChildrenCount = 0;
if ($iPid == 0)
{
// child
echo ("child $icount\n");
}
else
{
// parrent
}
}
this is essential what you do in your example? If so, this code does
not start 10 children. It starts more.
Thats right - with the code above, each new child will continue creating
more processes. To get exactly 10 children running the same code:
if ($iPid == 0)
{
// child
echo ("child $icount\n");
// do childish stuff
// then exit
exit;
}
/Per Jessen, Zürich
for($icount=0;$icount<11;$icount++)
Iterates 10 times??
Hmm
.
- Follow-Ups:
- Re: [PHP] Re: process creation
- From: Per Jessen
- Re: [PHP] Re: process creation
- References:
- process creation
- From: "bruce"
- Re: process creation
- From: Nathan Rixham
- Re: [PHP] Re: process creation
- From: Török Alpár
- Re: [PHP] Re: process creation
- From: Nathan Rixham
- Re: [PHP] Re: process creation
- From: Török Alpár
- Re: [PHP] Re: process creation
- From: Per Jessen
- process creation
- Prev by Date: Re: [PHP] Captha Image Matching the Session Value.
- Next by Date: Re: [PHP] Captha Image Matching the Session Value.
- Previous by thread: Re: [PHP] Re: process creation
- Next by thread: Re: [PHP] Re: process creation
- Index(es):
Relevant Pages
|