Re: [PHP] Re: Fork and zombies

2009-03-18 Thread Per Jessen
Waynn Lue wrote: >> >> Yeah, that's what I ended up doing, and defining some global >> variables so that I could re-use the previous functions I created, >> thanks for the help! >> >> One other question I had, is pcntl_waitpid necessary in this case? >> Passing WNOHANG to it causes it to return i

Re: [PHP] Re: Fork and zombies

2009-03-18 Thread Waynn Lue
> > Yeah, that's what I ended up doing, and defining some global variables so > that I could re-use the previous functions I created, thanks for the help! > > One other question I had, is pcntl_waitpid necessary in this case? Passing > WNOHANG to it causes it to return immediately regardless of wh

Re: [PHP] Re: Fork and zombies

2009-03-18 Thread Waynn Lue
> > > Whoops, I spoke too soon, I think the sleep(3) causes the child not to > > exit before the parent. If instead I don't pass WNOHANG to the > > waitpid command, it does error out. So it looks like your theory is > > correct, and I still have that problem. I guess the only solution is > > to

Re: [PHP] Re: Fork and zombies

2009-03-18 Thread Per Jessen
Waynn Lue wrote: > Whoops, I spoke too soon, I think the sleep(3) causes the child not to > exit before the parent. If instead I don't pass WNOHANG to the > waitpid command, it does error out. So it looks like your theory is > correct, and I still have that problem. I guess the only solution is

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Waynn Lue
> > > 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

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Waynn Lue
> > > 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

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Jochem Maas
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

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Per Jessen
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 >> t

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Ashley Sheridan
On Tue, 2009-03-17 at 17:06 -0400, George Larson wrote: > If "Fork and Zombies" was a diner... I would totally eat there. For fork sake... ;) Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread George Larson
If "Fork and Zombies" was a diner... I would totally eat there. On Tue, Mar 17, 2009 at 5:00 PM, 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

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Jochem Maas
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

[PHP] Re: Fork and zombies

2009-03-17 Thread Waynn Lue
(Apologies for topposting, I'm on my blackberry). Hm, so you think exiting from the child thread causes the db resource to get reclaimed? On 3/17/09, Per Jessen wrote: > Waynn Lue wrote: > >> Ah, I was changing it to waiting for each child to finish in order to >> see if I could narrow down my db

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Per Jessen
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. /Per -- Per Jessen, Zürich (8.9°C) -- PHP Ge