Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How to tell a child what to do?

by Zaxo (Archbishop)
on Sep 21, 2005 at 09:33 UTC ( #493702=note: print w/ replies, xml ) Need Help??


in reply to How to tell a child what to do?

On (4.), what is killing your children before their task is done?

There are lots of ways to talk to child processes. If there is a small fixed set of messages, signaling with kill is effective, with %SIG copy-on-write. If you need more extensive communication, pipes are my favorite, but sockets are also good. Each child will need to parse what you send it. See perlipc for details.

Another way is to only launch a child when it and the parent will know what it's supposed to do. That's best on systems, like Linux, where fork is cheap.

After Compline,
Zaxo


Comment on Re: How to tell a child what to do?
Re^2: How to tell a child what to do?
by Eyck (Priest) on Sep 21, 2005 at 09:55 UTC

    A: You (as a designer) don't know.

    Anyhoo, some tasks may take forever, thus you need to keep it running indefinitely.

    I don't know how launching a child only when task is ready is going to help, you still need to tell your newborn child what kind of tasks you prepared for them ( ie, pass some argument, I would go for $ARGV[], this seems simplest ).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-01 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (13 votes), past polls