| | |
kill parent and retain child process?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2005
Posts: 71
Reputation:
Solved Threads: 1
uth,
You can create a new thread at any time. Then if you so desire, let the 'main' thread die by letting the 'public static main' function return. If the thread you created is a 'daemon' thread the JVM will exit all together. However if the thread you created was a 'user' thread the JVM will not exit straight away, instead another thread will be automatically created called 'DestroyJavaVM' which will wait until all 'user' threads return and then kill the JVM. But why would you want to do this, one thread is as good as any other.
Kate
You can create a new thread at any time. Then if you so desire, let the 'main' thread die by letting the 'public static main' function return. If the thread you created is a 'daemon' thread the JVM will exit all together. However if the thread you created was a 'user' thread the JVM will not exit straight away, instead another thread will be automatically created called 'DestroyJavaVM' which will wait until all 'user' threads return and then kill the JVM. But why would you want to do this, one thread is as good as any other.
Kate
•
•
Join Date: Apr 2006
Posts: 4
Reputation:
Solved Threads: 0
Hi Kate,
What I need to do is have another instance of the same class running and shut down the existing instance. Will try what you suggested today!Thanks!
What I need to do is have another instance of the same class running and shut down the existing instance. Will try what you suggested today!Thanks!
•
•
•
•
Originally Posted by Kate Albany
uth,
You can create a new thread at any time. Then if you so desire, let the 'main' thread die by letting the 'public static main' function return. If the thread you created is a 'daemon' thread the JVM will exit all together. However if the thread you created was a 'user' thread the JVM will not exit straight away, instead another thread will be automatically created called 'DestroyJavaVM' which will wait until all 'user' threads return and then kill the JVM. But why would you want to do this, one thread is as good as any other.
Kate
![]() |
Similar Threads
- Parent/Child Windows References (JavaScript / DHTML / AJAX)
- ambiguous part 3 (C)
- Problem with execv argument passing (C++)
- Making a UNIX Shell, so inexperienced at it (C++)
- running a process from a python program (Python)
Other Threads in the Java Forum
- Previous Thread: need help with very very basic java
- Next Thread: J2EE and TCP
Views: 6835 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Java
3d @param affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth byte c# chat class classes click client code color compare component corrupted database detection draw eclipse error event exception file fractal game givemetehcodez graphics gui guitesting helpwithhomework html ide image input integer j2me java java.xls javaprojects jmf jni jpanel julia keytool linux list loop map method methods mobile netbeans newbie number object oracle pong print problem producer program programming project projectideas read recursion reflection replaysolutions rim scanner screen server set size sms socket sort sql string swing terminal test threads time transfer tree web windows





