Re: fork exitting sub

2002-09-26 Thread Michael Fowler
Others have addressed various other parts of your code, such as why you're forking twice, what the while loop is for, etc. However, there are a few things in your code that others haven't addressed. On Thu, Sep 26, 2002 at 09:20:37AM -0400, chad kellerman wrote: [snip] > foreach my $usr (@users

Re: fork exitting sub

2002-09-26 Thread david
Chad Kellerman wrote: > david, > > actually, without the while loop every user in the array gets forked > at one time. 500+ forks. I put the while loop in and it does one at a > time.. > maybe i am missing something but how is this: > foreach my $usr (@users) { > my $UsrPid; >

Re: fork exitting sub

2002-09-26 Thread chad kellerman
david, actually, without the while loop every user in the array gets forked at one time. 500+ forks. I put the while loop in and it does one at a time.. chad On Thu, 2002-09-26 at 14:28, david wrote: > Chad Kellerman wrote: > > > I have: > > > > foreach my $usr (@users) { > > my $

Re: fork exitting sub

2002-09-26 Thread david
Chad Kellerman wrote: > I have: > > foreach my $usr (@users) { > my $UsrPid; > unless ($UsrPid = fork) { > while fork { > do stuff > exit 0; > } > exit 0; i don't understand why you need another 'while fork' her

RE: fork exitting sub

2002-09-26 Thread Kipp, James
D] > Subject: RE: fork exitting sub > > > James, > > The script is too long. I fork because I tar thru ssh which uses > memory. So that server I am on doesn't go done because of memory > consumption I fork each tar so when the fork dies the memory is freed >

RE: fork exitting sub

2002-09-26 Thread chad kellerman
James, The script is too long. I fork because I tar thru ssh which uses memory. So that server I am on doesn't go done because of memory consumption I fork each tar so when the fork dies the memory is freed for the system.. I really think I have issues with my exit 's.. I am going to

RE: fork exitting sub

2002-09-26 Thread Kipp, James
> > James, > >I an tarring up different directories. Directories that may be in > home or maybe in another location. The directories in home are @users > and the directories in another location are @otherusrs. The thing is > the directories in the other location might not exist. > I

RE: fork exitting sub

2002-09-26 Thread chad kellerman
James, I an tarring up different directories. Directories that may be in home or maybe in another location. The directories in home are @users and the directories in another location are @otherusrs. The thing is the directories in the other location might not exist. I read that before

RE: fork exitting sub

2002-09-26 Thread Kipp, James
> foreach my $usr (@users) { > my $UsrPid; > unless ($UsrPid = fork) { > while fork { > do stuff > exit 0; > } > exit 0; >} >waitpid($UsrPid,0); > } > if (defined @otherusers) > foreach my