Eyck has asked for the wisdom of the Perl Monks concerning the following question:
I need a way to communicate with children (possibly non-blocking and reliable way).
'Spose I do something like this:
- I fork of a bunch of children, to await my command
- I figure out a tasks that need to be done
- I tell each child what needs to be done
- When some child dies, I check what was his task, and tell some other available child to do it.
The hard part seems to be communicating with children, with one child, I would probably use STDIN/STDOUT, servers like apache have symmetrical children, so I'm kind of lost as to what is the best way to do something like that.
UPDATE Re^4: How to tell a child what to do? contains lite & correct solution.
UPDATE OK, it seems like merlyn has written a column about the subject, with a line-by-line commentary, which is good. (but overall, I still quite like Anonymous Monk's solution) Re: How to tell a child what to do?
Back to
Seekers of Perl Wisdom