in reply to TCL, fork and memory

Let me see, here.

1) You provide no code.
2) You provide no information as to what the child processes are doing.
3) You provide no OS information (not that it's really necessary, but it could help).

Sorry, dude. Like most all the other monks here, I never quite gained the ability to help others with "guess what my code looks like and guess what my child processes are doing" fork() problems.

davidj

Replies are listed 'Best First'.
Re^2: TCL, fork and memory
by EggMan (Initiate) on Sep 08, 2004 at 13:09 UTC
    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.