Geir Magnusson Jr wrote:
Oliver Deakin wrote:
The example returns once they have fixed it. If you look at the example
just before the "Why Runtime.exec() hangs" heading (BadExecJava2.java)
you will see a situation that is almost exactly the same as in the test
case.
i.e. an exec followed by a waitFor(), without any reading of streams.
In this case the exec never returns.

The later example is how to fix it.

I don't think so.

When they are saying "the exec never returns", they are meaning that
from the POV of the programmer, the spawned thing never returns.

That's why you can do

exec()
do IO
waitFor()
done

However, in our case, when I say "exec never returns" I mean "exec()"
never returns.

so you'd never actually get to "do IO" above, because you are hanging in
exec().

Big difference, right?

Certainly - do you have a stack trace that gives more info for what each of the threads are doing? Could you attach it to the JIRA if you do please - Ive just tried running a cut down version of the test on my SLES9 machine and it exited fine, so it would be useful to have
a trace from your machine to see what's happening.

Thanks,
Oliver

geir


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Oliver Deakin
IBM United Kingdom Limited


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to