Child process stops when Thread.sleep () is called (in Java on Windows)

I have a Java application that starts an external process (Internet Explorer) using ProcessBuilder. Oddly enough, this child process hangs when the parent Java thread calls Thread.sleep. This does not happen with all processes, for example Firefox, but with IE it happens all the time.

Any ideas?

PS I tried Robot.delay () with the same effect

+2


source to share


1 answer


How do you consume the stdout and stderr child process? It might be worth posting your code.



You need to use output streams at the same time, otherwise your stdout or stderr buffer will fill up and your child process will block. See here for details .

+5


source







All Articles