How to read from a process stdout without it blocking?

Then select() is probably your choice (see also this comment). But I am not sure if this is really good advice.