java.lang.Process.waitFor()

Mohan Embar gnustuff@thisiscool.com
Sun Sep 28 15:04:00 GMT 2003


Hi Erik,

>I thought in direction too, but I don't know if I can apply it. I'm starting three
>threads. One feeds input to stdin; the two others capture output from stdout and
>stderr. I shouldn't interfere or block anything until the child process has exited;
>the threads should run inimpeded until then. Would you know how to introduce an
>object here?

You don't need an object. See the JavaDoc for Thread.join().

You seem to be going down the path suggested in this nice article (cf. StreamGobbler):

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html

I prettied this up once, but can't find the code anymore. I think I might have also
added a Thread.join(), but can't remember.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/






More information about the Java mailing list