| | |
kill parent and retain child process?
![]() |
•
•
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
| Thread Tools | Search this Thread |
911 addball addressbook android api append applet application apps array arrays automation binary bluetooth businessintelligence button card character class client code collision component crashcourse css csv database eclipse ee error fractal free game gis givemetehcodez graphics gui html ide image integer integration j2me japplet java javaarraylist javadoc javafx javaprojects jni jpanel julia jvm linux list loan machine map method methods migrate mobile netbeans newbie objects oriented output panel phone physics problem program programming project projects radio recursion replaydirector reporting researchinmotion scanner se server service set sms software sort sql string swing test textfield threads transfer tree trolltech ubuntu utility windows





