Re: Re: Fork and zombies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Per Jessen schreef:
> Jochem Maas wrote:
> 
>> Per Jessen schreef:
>>> Waynn Lue wrote:
>>>
>>>> (Apologies for topposting, I'm on my blackberry). Hm, so you think
>>>> exiting from the child thread causes the db resource to get
>>>> reclaimed?
>>>>
>>> Yeah, something like that. The connection is definitely closed when
>>> the child exits.
>>>
>> I can confirm this. you definitely need to open a connection for each
>> child process. if you require a db connection in the parent process,
>> you should close it before forking (and then reopen it afterwards if
>> you still need it).
> 
> Yep, exactly my thinking. 
> 
>> at least that's what I found I had to do when I ran into this.
>> incidently my forking loop looks like this, very interested to know if
>> Per can spot any obvious stupidity:
> 
> I doubt it. 
> I can't quite follow your code after the pcntl_wait where you've got a
> pcntl_kill(), but it looks like an insurance policy?  "just in case" ?
> 

correct, from my reading the pcntl_kill() with a signal argument of zero should
return true if it is *able* to send the signal (but it doesn't actually send anything),
given that it's only checking it's own children the parent process must able to
send them signals assuming they're not somehow dead ... so yeah, insurance policy :-)

> 
> /Per
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux