in reply to fork processes

I don't know if it's just an error in pasting, but while (( $available_machine) && ($request_file_exists){is not valid Perl - you forgot a closing round bracket. I'm not entirely sure there there's no circumstance under which this might mistakenly parse. Assuming that's not the problem, where do $available_machine and $request_file_exists get changed? I don't see them altered in the loop. If they're being changed in a part of the code you left out, you may have a fencepost error (ie your loop conditions do not get changed as early as you're expecting).

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: fork processes
by arodri7 (Initiate) on Jun 05, 2002 at 15:19 UTC
    Sorry Screamer, I left the part where $available machines and $request_file_exists get updated. Before the code I had written, I check to see how many machines are available and put them in an array, as well as the $request_file_exists variable and as long as any of the two arrays are not empty (I left out the part where I use pop(@arrays) to update the variables) I keep going through the loop. But when I get to the last machine, it repeats its process twice. I update those variables in the "while" line. The code that I use to change the $variables is:
    #start submitting jobs for the not_yet_run requests while (( $usable_machine = pop(@$usable) ) && ( $request_file = pop(@a +ll_requests) )){ #use the code I had before }
    Let me know what ya think Thanks
      I figured out why it was repeating the previous fork porcesses each time it looped. I had not closed the child process and it was creating zombies (I guess that is what is called). Thanks for the help