Plans for Kernel.fork?


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 ?


– Thibaut

Unfortunately, fork is not something that is really possible with the
JVM* <---- note the asterisk :slight_smile:


    • 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

  • JRuby.

On Mon, Mar 1, 2010 at 9:34 AM, Thibaut Barrère
[email protected] wrote:

– Thibaut

blog: twitter: tom_enebo
mail: [email protected]

To unsubscribe from this list, please visit:

Hi Thomas,

thanks for the detailed explanation. Actually I don’t need to use fork,
was just trying to understand if fork was likely to be supported later
(to see if some code needs reworking or not)


– Thibaut