New methods in jdk7

Martin Buchholz martinrb at
Wed Oct 7 06:55:46 UTC 2009

On Tue, Oct 6, 2009 at 09:40, Paulo Levi <i30817 at> wrote:
> I thought there was the danger of deadlocks if the std.out and std.err
> wasn't drained?

Well, yes, there is a danger of deadlocks, but this can be avoided by:
- having separate threads read stdout and stderr
- closing the various streams in the parent (but might cause child to exit)
- using redirectErrorStream
- using new redirection facilities in jdk7

> To be clear, you're saying that if i call this, and allow the parent
> to be killed (by throwing a Error for instance), the child process
> lives still? (I believe i can't call System.exit(1) without all jvm
> dying right?)

Why not try it?  System.exit should only cause one jdk to exit directly.


More information about the core-libs-dev mailing list