N
Nishi Bhonsle
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.
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.