Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Pre-Forking Daemon with Parallel::ForkManager

by ikegami (Pope)
on Oct 19, 2019 at 13:37 UTC ( #11107696=note: print w/replies, xml ) Need Help??


in reply to Pre-Forking Daemon with Parallel::ForkManager

my $pm = Parallel::ForkManager->new(NUM_CHILDREN); for (1..NUM_CHILDREN) { $pm->start and next; my $client_sock = $server_sock->accept or die $!; ... $pm->finish; }

Note: It'll use a new process for each request, but the process will be created as soon as the previous request is complete (even if no requests are pending).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11107696]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2019-11-12 02:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (64 votes). Check out past polls.

    Notices?