in reply to Re: TCL, fork and memory
in thread TCL, fork and memory
Sorry for a month+ delay and for no code delivered.
My code is a GUI for setting some parameters and
eventually launching a PERL script Xtimes
with some arguments.
the code body is:
TK code
.... external loop:
while (!defined($pid = fork()))
{ print "NO PIDS..\n"; sleep 1 }
if (!$pid) { system "..." ; CORE::Exit(); } ## NO "&" !
else { $$TasksHash_{$pid}=$ShownButtons{$key}};
.... end of external loop.
INT code:
sub CHILED
{
my $stiff;
while (($stiff = waitpid(-1, &WNOHANG)) > 0)
{ $$TasksHash_{$stiff}->destroy if $$TasksHash_{$stiff}}
$SIG{CHLD} = \&CHILED ;
}
The "system" call dies when "out of memory",
why this happens?,br>
Thanks, Daniel.