but this sounds ineffiecient to me.
What would you do?
Semaphores, yes. My decision would proceed as:
- Don't do this at all: I don't need such multiprocessing.
- Have pipes for each child, with a protocol wherein children may request tasks and the parent may supply them with tasks. As long as I'm writing a protocol, it may as well also carry feedback from the tasks.
- Use POE instead.
- Use (not Perl:) Erlang instead.
- Fail, colour the problem as insurmountable and backtrack within my overarching design.