I have no need for Kernel.fork personnaly right now, but I’m wondering
because some code I use (Resque workers) optionally rely on fork if it’s
supported, so I may tweak it more if Kernel.fork is planned.
What is the trend: is Kernel.fork not planned for implementation at all,
is it temporary ?
Unfortunately, fork is not something that is really possible with the
JVM* <---- note the asterisk
Actually we do have a flag for turning on fork, but largely it
does not work. The fork() call when called only forks the current
executing thread, but does not replicate anything else neccesary for a
forked copy of the JVM to keep running (for example, things like the
garbage collector). Because of this I doubt we will ever see a
reasonable fork for the JVM.
PS- Another wrinkle in fork is that it does not work on windows. You
may or may not care about this…
PPS- If you just want the fork/exec pattern you should consider
Charlie’s spoon gem. It uses ffi and spawn and is portable across MRI