Q: What is a practical application of pipes?


A practical application of pipes can be found in the implementation of a daemon. Often daemons are implemented by a program listening on a port for a service request. Once a service request is made (or a connection is established), the daemon typically creates a child process to deal with the connection request. The daemon can then immediately resume waiting for more service requests. Multiple service requests can be processed concurrently in this manner.

If the daemon needs to communicate information to the child (e.g. the port # that it was listening on, the type of service being requested, or the IP of the connected client), one avenue would be via pipes. The child may also want to write something back to the parent (e.g. a message indicating that it is free to service other requests).