Nate Williams <nate_at_yogotech.com> writes: > > I have serious problems with " Runtime.getRuntime ().exec ()" : either > > it hangs or gives a spinning mutex running at 99% cpu. > > This is a Java FAQ, Oops. Sorry for the noise .... > and is unrelated to FreeBSD. This program will hang > on any OS once you reach a certain threshold of unread output that the > OS will block the process until something 'reads' the data. > > What you need to do is once you execute the command, you need to have a > process that reads the output from the process. OK. I see (and most often do); but indeed I didn't in cases where I were just interested in the exit value of the command (and then afterwards read "proc.getErrorStream" to see what went wrong ... ). Thank you very much for your help. > [ .. ] > Here is my (trivial) implementation, use it as you see fit. > [ .. ] Thanx! I'l try. > Why it works on linux-sun-jdk15 is probably due to the fact that there > is more stack space allocated to processes, but if you modified the > process to generate more output ('ls -R /'), it will eventually fail. Yop, you're right. Best, Arno (a bit ashamed)Received on Sun Nov 18 2007 - 00:48:17 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:22 UTC