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

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -