On 19-Jul-2001 Rocco Caputo wrote:
> The easiest workaround I can see is to have the parent process create
> a listening socket (probably with IO::Socket::INET) and keep a copy of
> it in its HEAP.  Each child processe would immediately start a
> ListenAccept wheel on the saved socket as their first task.

IKC does something worse, it messes with the wheel ;)  Basically, it does

    my $state;
    if($on) {
        $state=$heap->{wheel}->[5];
    }
    $poe_kernel->select_read($heap->{wheel}->[0], $state);

With support for the old hash-based Wheel's and a bit of extra error
checking thrown in.  Look at _select_define in

http://pied.nu/Perl/POE-Component-IKC/IKC/Server.pm



 
> Mind you, the child processes don't have to exit if they don't leak
> resources.  I modelled the idea after Apache, which recycled child
> processes now and then to prevent runaway daemons.

Perl processes will allocate much more memory then an apache process will.
Apache uses pools to make sure that resources are cleared in an orderly
manner.  While perl does reuse this, eventually the processes will share
very little memory, and use much more ram and swap space.  Of course, this
is probably application-specific.  I'm going to eventually spin off the
child handling code from IKC and have it accept a variety of possible
scenarios.

-Philip

Reply via email to