Process Runtime.exec causes subprocess hang.
From: Nishi Bhonsle (nishi.bhonsle_at_oracle.com)
Date: 01/31/04
- Next message: Berlin Brown: "Re: Join Us for the 2004 No Fluff Just Stuff Java Symposium Tour"
- Previous message: sarah chang: "Re: Trying to install Apache AXIS on WAS 4 AE"
- Next in thread: Matt Humphrey: "Re: Process Runtime.exec causes subprocess hang."
- Reply: Matt Humphrey: "Re: Process Runtime.exec causes subprocess hang."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 15:26:06 -0800
Hi:
I am facing an issue on windows platform using Runtime.exec in my java program. The parent process executing Runtime.exec is not able to consume the output stream of the child process and hence the former is blocked or hangs.
I found this mentioned in the java doc on Process
"The parent process uses these streams(Process.getOutputStream(), Process.getInputStream(), Process.getErrorStream()) to feed input to and get output from the subprocess. Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock. "
In my case the output from the child process is 2-4Kbyte long. How can I workaround this hang/deadlock issue on windows platform?
Any help would be appreciated.
Thanks.
- Next message: Berlin Brown: "Re: Join Us for the 2004 No Fluff Just Stuff Java Symposium Tour"
- Previous message: sarah chang: "Re: Trying to install Apache AXIS on WAS 4 AE"
- Next in thread: Matt Humphrey: "Re: Process Runtime.exec causes subprocess hang."
- Reply: Matt Humphrey: "Re: Process Runtime.exec causes subprocess hang."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]