Is it possible to create a complete fork of a 'PROGRAM' in execution into two sub-programs from a single execution sequence ?
The sub-programs produced are completely identical. They have the same execution sequences and values but now they are two different programs. It is like creating a clone of an Object, thus giving us two different objects of the same type to work on. But instead of just an object and some values, here we want to create a completely parallel execution sequence of a Program already loaded in the JVM (would prefer an answer for Java).
You seem to be looking for the Java equivalent of the fork system call from Unix.
That does not exist in Java, and it's unclear whether it would even be possible, as processes in Unix don't have a direct equivalent in the JVM (threads are less independent than processes).
There is however a fork framework planned for Java 7:
http://www.ibm.com/developerworks/java/library/j-jtp11137.html
It's not the same as Unix'es fork/join, but it shares some ideas and might be useful.
Of course you can do concurrent programming in Java, it's just not done via fork(), but using Threads.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With