serialize two processes using pipes.