Ok here is what i have
:
the error msg that the script prints afther it have reached 64 processes is:
"
open2: IO::Pipe: Can't spawn-NOWAIT: Resource temporarily unavaliable at
msg_cracker.pl line 443 "

the part of the code is this
}

close TEMPFILE;

} elsif ($Param[1] eq '2wayproc') {

$ExtPid = open2(*ExtReader, *ExtWriter, $TempValue );

shout ('debug',"OPEN2: Two-way process with PID $pid spawned.");

select(ExtWriter); $| = 1; select(STDOUT);

}

return;

A friend of mine told me that he did this to his code..

Suppose you run the child process in a loop like I did :

LOOP: while (condition) {

eval { $pid = open2($FHFROM,$FHTO,$Exe,@Params); };
if ($@) {
# then there is an open2() error and error code/message is in $@
}

unless (defined $pid) {
# then the child could not be started for some reason
}


# Now we talk to the child, the child does whatever it has to do and stops

# When we're done ..
# Close up our pipes, collecting status on the way
# By the way, I don't know on which close() we collect the status,
documentation doesn't say
unless (close $FHTO) {
$status = $? >> 8; # get program exit code ?
# etc...
}
unless (close $FHFROM) {
$status = $? >> 8; # get program exit code ?
# etc...
}

sleep 1; # give it time to exit (maybe)

# And here is the essential part to avoid the "Resource not available.." error
:
# waitpid() cleans that child process's remainders out of the process table,
# which otherwise fills up and eventually leads to the "resource not available"
error

$status = waitpid($pid,0);
# I suppose should also get the child exit code in $status


} # end while LOOP


BUT i changed some thngs to use in my prog but it did not work...

Please can someone help me
Thnaks




_________________________________________________________________
MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to