in reply to Pipes? Child Processes?

Sometimes you want to do many things at once. For example, imagine that you have database of URLs you want to index.

You could write a perl script that would request each URL and process the resulting doc. Or, you could write a script that would fork many children to request and process the URLs. The parent script can then manage the children and harvest the data that they produce. Since this sort of application is unlikely to be bound by CPU, RAM or network bandwidth (latency would be the key issue here), it is an excellent candidate for this approach.

Sometimes forking is used to reduce exposure to security risks. A process may need to have an elevated level of access to complete a task. If most of the task can be achieved with limited access, it can be useful to fork and exec a tool that is limited to executing the portion of the task that needs enhanced access.


TGI says moo