>Besides Runtime.exec("executiable name"), what are the other ways to
>"fork a process" in Java.
you can start a Thread which is internal to the JVM.
That's it as far as I know. Anything else would be platform specific
and require JNI.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
> Hello:
>
[quoted text clipped - 4 lines]
>
> JJ
As far as I'm aware, you "fork" a process by using threads. You'ld have to
Google it more though, thats as far as I know. Hope it helps
Wibble - 27 Mar 2006 02:58 GMT
>>Hello:
>>
[quoted text clipped - 7 lines]
> As far as I'm aware, you "fork" a process by using threads. You'ld have to
> Google it more though, thats as far as I know. Hope it helps
A thread isn't a processess. The only way other
than Runtime.exec is to write JNI code (java native interface).
You probably dont really want to fork a process, right?
> Besides Runtime.exec("executiable name"), what are the other ways to
> "fork a process" in Java.
The almost unknown java.lang.ProcessBuilder
Don't ask me why Sun added this in 1.5.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
> Hello:
>
> Besides Runtime.exec("executiable name"), what are the other ways to
> "fork a process" in Java.
AFAIK, there is no fork concept in java, thats a unix thing. The only
concepts available are starting a new application (exec) and starting
new threads. There might be some library that have implemented fork etc
through jni (I know there is for posix pipes, shared memory etc.), that
would give you almost the full power of fork and the unix process
concept. But sadly its not supported in java.
/tom
Thomas Hawtin - 27 Mar 2006 17:14 GMT
> AFAIK, there is no fork concept in java, thats a unix thing. The only
> concepts available are starting a new application (exec) and starting
> new threads. There might be some library that have implemented fork etc
> through jni (I know there is for posix pipes, shared memory etc.), that
> would give you almost the full power of fork and the unix process
> concept. But sadly its not supported in java.
Indeed, Windows creates new processes rather than forks (although
presumably it can do some kind of fudged fork for POSIX). I don't like
the chances of the JRE keeping it together if you try to use it from
both legs.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
James McGill - 27 Mar 2006 18:45 GMT
> AFAIK, there is no fork concept in java, thats a unix thing.
A fork() would amount to a copy of the JVM. I get no further than that
when I realize it's too complicated to even think about.