Some time ago, I showed a way to avoid deadlocks when reading the redirected console of a child process in a synchronous way. It works, but only when we have to deal with a single output stream – standard output or standard error stream. But what should be done when both streams are flooded with data?
Reading redirected child output seems to be an easy task. But there are developers that struggle with child process hanging because of console write / read deadlocks. And deadlocks are never easy to investigate.
I often hear questions about running sub-process in parent’s console. People got confused about how to make sure that the child process uses the same console as the parent.