Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: threads: spawn early to avoid the crush.

by Anonymous Monk
on Mar 02, 2006 at 16:46 UTC ( #533970=note: print w/replies, xml ) Need Help??


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

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";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2020-07-11 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?