java - How long does the JVM wait for a thread -


hi every java developper, have juste simple question jvm, want know how long jvm wait thread ? example, take @ code :

public static void main(string[] args) {  p = runtime.getruntime().exec("myshellcommand -p1 v1 -p2 v2");  p.waitfor();  system.out.println("end ....:)"); } 

suppose "myshellcommand" running ever, whats happen ? jvm still waiting ever ?

the waitfor method causes current thread wait, if necessary, until process represented process object has terminated. method returns if subprocess has terminated. if subprocess has not yet terminated, calling thread will blocked until subprocess exits.(from javadoc).

based on documentation, think run forever.


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -