In one process, how can we create another process that is an exact copy of the parent?
-
Using java in one process, how can we create another process that is an exact copy of the parent?
-
Answer:
You can't do that using pure Java. In the C world you'd simply use http://en.wikipedia.org/wiki/Fork_%28operating_system%29, but Java has no direct support for this. You might be able to call fork() from some http://en.wikipedia.org/wiki/Java_Native_Interface code (or using http://en.wikipedia.org/wiki/Java_Native_Access), but I doubt that your average JVM implementation is built to handle that gracefully.
user707549 at Stack Overflow Visit the source
Other answers
You can create another process which has the same command line arguments with Runtime.exec(). However you cannot do a C-style fork from pure Java. It would be heard to imagine why you would want to. I suspect what you are trying to do is best done another way. Can you give more details as you why you want to do this?
Peter Lawrey
Related Q & A:
- How can I create my own hosted svn server?Best solution by stackoverflow.com
- How do I create another screen name?Best solution by Yahoo! Answers
- How do i create another email address?Best solution by Yahoo! Answers
- How do i create another yahoo e-mail?Best solution by Yahoo! Answers
- How Can I Create an XML to Create a Menu?Best solution by Drupal Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.