in reply to Re: threads: spawn early to avoid the crush.
in thread threads: spawn early to avoid the crush.

If the main program needed another process it would ask the original parent to do it for it.

Could you explain that in a bit more detail for me? I've never done much with fork, especially in Perl.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^2: threads: spawn early to avoid the crush.

Replies are listed 'Best First'.
Re^3: threads: spawn early to avoid the crush.
by Anonymous Monk on Mar 02, 2006 at 16:46 UTC
    Here's a simple answer to interprocess communication: use pipes.
    #!/usr/bin/perl -w #use forking open to start 3 more processes unless (open X, "-|") { print 1+5; exit }; # X=1+5 unless (open Y, "-|") { print 2*3; exit }; # Y=2*3 unless (open Z, "-|") { print <X>+<Y>; exit }; # Z=X+Y print "Z = "; print <Z>."\n";