Re: New methods in jdk7

2009-10-06 Thread Martin Buchholz
On Tue, Oct 6, 2009 at 09:40, Paulo Levi 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 p

Re: New methods in jdk7

2009-10-06 Thread Paulo Levi
I thought there was the danger of deadlocks if the std.out and std.err wasn't drained? In fact my implementation of "fork" is like this, mostly because i read that otherwise deadlocks happened.: /** * This method creates a new process that will run a new jvm * on the main of the give

Re: New methods in jdk7

2009-10-05 Thread Martin Buchholz
On Mon, Oct 5, 2009 at 06:49, Paulo Levi wrote: > ProcessBuilder shenanigans wouldn't work, because when the parent jvm > dies the child must too right? There's no reason why the child should not be able to outlive the parent. The child will get end of file on the pipes connected to the parent, b

New methods in jdk7

2009-10-05 Thread Paulo Levi
Since i heard you were looking for suggestions, i think i might have a useful one that i think is impossible nowadays without native code. public void restart(); At first i thought it could be simulated just by calling the main class again in a shutdown hook, but i don't think all the static state